push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchurl,
libGLU,
libXmu,
libXi,
libXext,
testers,
mesa,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "glew";
version = "1.10.0";
src = fetchurl {
url = "mirror://sourceforge/glew/glew-${finalAttrs.version}.tgz";
sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
};
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [
libXmu
libXi
libXext
];
propagatedBuildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ libGLU ]; # GL/glew.h includes GL/glu.h
outputs = [
"out"
"dev"
];
patchPhase = ''
sed -i 's|lib64|lib|' config/Makefile.linux
${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
''}
'';
buildFlags = [ "all" ];
installFlags = [ "install.all" ];
preInstall = ''
export GLEW_DEST="$out"
'';
postInstall = ''
mkdir -pv $out/share/doc/glew
mkdir -p $dev/lib/pkgconfig
cp glew*.pc $dev/lib/pkgconfig
cp -r README.txt LICENSE.txt doc $out/share/doc/glew
'';
makeFlags = [
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
"CC:=$(CC)"
"LD:=$(CC)"
];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "OpenGL extension loading library for C(++)";
homepage = "https://glew.sourceforge.net/";
license = licenses.free; # different files under different licenses
#["BSD" "GLX" "SGI-B" "GPL2"]
pkgConfigModules = [ "glew" ];
inherit (mesa.meta) platforms;
};
})

View File

@@ -0,0 +1,100 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
cmake,
libGLU,
libXmu,
libXi,
libXext,
enableEGL ? (!stdenv.hostPlatform.isDarwin),
testers,
mesa,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "glew";
version = "2.2.0";
src = fetchurl {
url = "mirror://sourceforge/glew/glew-${finalAttrs.version}.tgz";
sha256 = "1qak8f7g1iswgswrgkzc7idk7jmqgwrs58fhg2ai007v7j4q5z6l";
};
outputs = [
"bin"
"out"
"dev"
];
patches = [
# https://github.com/nigels-com/glew/pull/342
(fetchpatch {
url = "https://github.com/nigels-com/glew/commit/966e53fa153175864e151ec8a8e11f688c3e752d.diff";
hash = "sha256-xsSwdAbdWZA4KVoQhaLlkYvO711i3QlHGtv6v1Omkhw=";
})
# don't make EGL support disable GLX, use the same patch as ArchLinux
# https://gitlab.archlinux.org/archlinux/packaging/packages/glew/-/blob/ca08ff5d4cd3548a593eb1118d0a84b0c3670349/egl+glx.patch
(fetchpatch {
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/glew/-/raw/ca08ff5d4cd3548a593eb1118d0a84b0c3670349/egl+glx.patch?inline=false";
hash = "sha256-IG3FPhhaor1kshEH3Kr8yzIHqBhczRwCqH7ZeDwlzGE=";
})
# cmake 4 compatibility
(fetchpatch {
url = "https://github.com/nigels-com/glew/commit/a4d8b2a2a30576eb1b984ba5d573702acfc5b92e.diff";
hash = "sha256-S6Om0A4y5po2rHl8OXcue2zOcBpCmBZYvf10LfKEYfI=";
})
];
nativeBuildInputs = [ cmake ];
buildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [
libXmu
libXi
libXext
];
propagatedBuildInputs = lib.optionals (!stdenv.hostPlatform.isDarwin) [ libGLU ]; # GL/glew.h includes GL/glu.h
cmakeDir = "cmake";
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
]
++ lib.optional enableEGL "-DGLEW_EGL=ON";
postInstall = ''
moveToOutput lib/cmake "''${!outputDev}"
moveToOutput lib/pkgconfig "''${!outputDev}"
cat >> "''${!outputDev}"/lib/cmake/glew/glew-config.cmake <<EOF
# nixpkg's workaround for a cmake bug
# https://discourse.cmake.org/t/the-findglew-cmake-module-does-not-set-glew-libraries-in-some-cases/989/3
set(GLEW_VERSION "$version")
set(GLEW_LIBRARIES GLEW::glew\''${_glew_target_postfix})
get_target_property(GLEW_INCLUDE_DIRS GLEW::glew\''${_glew_target_postfix} INTERFACE_INCLUDE_DIRECTORIES)
set_target_properties(GLEW::GLEW\''${_glew_target_postfix} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE ""
IMPORTED_IMPLIB_RELEASE "GLEW"
IMPORTED_IMPLIB_DEBUG "GLEW"
)
EOF
'';
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
description = "OpenGL extension loading library for C/C++";
homepage = "https://glew.sourceforge.net/";
license = with licenses; [
# modified bsd
free
mit
gpl2Only
]; # For full details, see https://github.com/nigels-com/glew#copyright-and-licensing
pkgConfigModules = [ "glew" ];
platforms =
with platforms;
if enableEGL then subtractLists darwin mesa.meta.platforms else mesa.meta.platforms;
};
})