diff --git a/pkgs/by-name/li/libpciaccess/package.nix b/pkgs/by-name/li/libpciaccess/package.nix new file mode 100644 index 000000000000..e18595b1caf2 --- /dev/null +++ b/pkgs/by-name/li/libpciaccess/package.nix @@ -0,0 +1,81 @@ +{ + 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="; + }; + + 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 -V | 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; + badPlatforms = [ + # mandatory shared library + lib.systems.inspect.platformPatterns.isStatic + ]; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 133b26c65f80..0eea13eb658e 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -4,6 +4,7 @@ font-alias, font-util, gccmakedep, + libpciaccess, luit, pixman, }: @@ -12,6 +13,7 @@ self: with self; { inherit gccmakedep + libpciaccess luit pixman ; @@ -3197,37 +3199,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - libpciaccess = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "libpciaccess"; - version = "0.18.1"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/lib/libpciaccess-0.18.1.tar.xz"; - sha256 = "0xpslrjnfrc1a7y8f8qwnd3wq24ndpj2q77ds12mbnwand239x2a"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ "pciaccess" ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! libpthreadstubs = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index c03bd8383dff..1d94ca12b828 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -37,6 +37,7 @@ $pcMap{"GL"} = "libGL"; $pcMap{"gbm"} = "libgbm"; $pcMap{"hwdata"} = "hwdata"; $pcMap{"fontutil"} = "fontutil"; +$pcMap{"pciaccess"} = "libpciaccess"; $pcMap{"\$PIXMAN"} = "pixman"; $pcMap{"\$RENDERPROTO"} = "xorgproto"; $pcMap{"\$DRI3PROTO"} = "xorgproto"; @@ -264,6 +265,7 @@ print OUT <