diff --git a/pkgs/by-name/li/libpciaccess/package.nix b/pkgs/by-name/li/libpciaccess/package.nix new file mode 100644 index 00000000000000..9d53a7a3c546a6 --- /dev/null +++ b/pkgs/by-name/li/libpciaccess/package.nix @@ -0,0 +1,82 @@ +{ + lib, + stdenv, + fetchurl, + testers, + writeScript, + pkg-config, + meson, + ninja, + zlib, + netbsd, + hwdata, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "libpciaccess"; + version = "0.18.1"; + + src = fetchurl { + url = "mirror://xorg/individual/lib/libpciaccess-${finalAttrs.version}.tar.xz"; + hash = "sha256-SvQ0RLOK21VF0O0cLORtlgjMR7McI4f8UYFlZ2Wm+nY="; + }; + + # not sure if needed + hardeningDisable = [ + "bindnow" + "relro" + ]; + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + meson + ninja + ]; + + buildInputs = + [ zlib ] + ++ lib.optionals stdenv.hostPlatform.isNetBSD [ + netbsd.libarch + netbsd.libpci + ]; + + mesonFlags = [ + (lib.mesonOption "pci-ids" "${hwdata}/share/hwdata") + (lib.mesonEnable "zlib" true) + ]; + + passthru = { + updateScript = writeScript "update-${finalAttrs.pname}" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p common-updater-scripts + + version="$(list-directory-versions --pname ${finalAttrs.pname} \ + --url https://xorg.freedesktop.org/releases/individual/lib/ \ + | sort | tail -n1)" + + update-source-version ${finalAttrs.pname} "$version" + ''; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; + + meta = { + description = "Generic PCI access library"; + homepage = "https://gitlab.freedesktop.org/xorg/lib/libpciaccess"; + license = with lib.licenses; [ + mit + isc + x11 + ]; + pkgConfigModules = [ "pciaccess" ]; + # https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/blob/6cd5a4afbb70868c7746de8d50dea59e02e9acf2/configure.ac#L108-114 + platforms = + with lib.platforms; + cygwin + ++ freebsd + ++ illumos + ++ linux + ++ lib.platforms.netbsd # otherwise netbsd from the function arguments is used + ++ openbsd; + }; +}) diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index f5a046b29b7b60..18a280cafc99d2 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -264,6 +264,7 @@ font-alias, font-util, gccmakedep, + libpciaccess luit, }: @@ -272,6 +273,7 @@ inherit pixman; inherit gccmakedep + libpciaccess luit ; fontalias = font-alias; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index b1029a2e0a773f..8467a06e35179b 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -414,28 +414,6 @@ self: super: outputs = [ "out" "dev" ]; # mainly to avoid propagation }); - libpciaccess = super.libpciaccess.overrideAttrs (attrs: { - nativeBuildInputs = attrs.nativeBuildInputs ++ [ meson ninja ]; - - buildInputs = attrs.buildInputs ++ [ zlib ] - ++ lib.optionals stdenv.hostPlatform.isNetBSD [ netbsd.libarch netbsd.libpci ]; - - mesonFlags = [ - (lib.mesonOption "pci-ids" "${hwdata}/share/hwdata") - (lib.mesonEnable "zlib" true) - ]; - - meta = attrs.meta // { - # https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/blob/master/configure.ac#L108-114 - platforms = lib.fold (os: ps: ps ++ lib.platforms.${os}) [] - [ "cygwin" "freebsd" "linux" "netbsd" "openbsd" "illumos" ]; - badPlatforms = [ - # mandatory shared library - lib.systems.inspect.platformPatterns.isStatic - ]; - }; - }); - libpthreadstubs = super.libpthreadstubs.overrideAttrs (attrs: { # only contains a pkgconfig file on linux and windows meta = attrs.meta // { platforms = lib.platforms.unix ++ lib.platforms.windows; }; diff --git a/pkgs/servers/x11/xorg/tarballs.list b/pkgs/servers/x11/xorg/tarballs.list index 15600dcbdb750a..fd4cb2d43f7955 100644 --- a/pkgs/servers/x11/xorg/tarballs.list +++ b/pkgs/servers/x11/xorg/tarballs.list @@ -167,7 +167,6 @@ mirror://xorg/individual/lib/libdmx-1.1.5.tar.xz mirror://xorg/individual/lib/libfontenc-1.1.8.tar.xz mirror://xorg/individual/lib/libFS-1.0.10.tar.xz mirror://xorg/individual/lib/libICE-1.1.1.tar.xz -mirror://xorg/individual/lib/libpciaccess-0.18.1.tar.xz mirror://xorg/individual/lib/libSM-1.2.4.tar.xz mirror://xorg/individual/lib/libWindowsWM-1.0.1.tar.bz2 mirror://xorg/individual/lib/libX11-1.8.10.tar.xz