soil: fix dead url, enable on darwin

This commit is contained in:
Ryan Burns 2020-10-29 00:14:42 -07:00
parent cb9fab88c3
commit 981c8bb5e2
2 changed files with 34 additions and 15 deletions

View File

@ -1,28 +1,45 @@
{ stdenv, fetchurl, unzip, mesa, libX11, libGL }:
{ stdenv, lib
, Carbon
, fetchzip
, libGL
, libX11
}:
stdenv.mkDerivation {
name = "soil";
src = fetchurl {
url = "http://www.lonesock.net/files/soil.zip";
sha256 = "00gpwp9dldzhsdhksjvmbhsd2ialraqbv6v6dpikdmpncj6mnc52";
src = fetchzip {
url = "https://web.archive.org/web/20200104042737id_/http://www.lonesock.net/files/soil.zip";
sha256 = "1c05nwbnfdgwaz8ywn7kg2xrcvrcbpdyhcfkkiiwk69zvil0pbgd";
};
buildInputs = [ unzip mesa libGL libX11 ];
buildInputs = if stdenv.hostPlatform.isDarwin then [
Carbon
] else [
libGL
libX11
];
sourceRoot = "Simple OpenGL Image Library/projects/makefile";
preBuild = "mkdir obj";
preInstall = "mkdir -p $out/lib $out/include";
makeFlags = [ "LOCAL=$(out)" ];
buildPhase = ''
cd src
$CC $NIX_CFLAGS_COMPILE -c *.c
$AR rcs libSOIL.a *.o
'';
installPhase = ''
mkdir -p $out/lib $out/include/SOIL
cp libSOIL.a $out/lib/
cp SOIL.h $out/include/SOIL/
'';
meta = {
meta = with lib; {
description = "Simple OpenGL Image Library";
longDescription = ''
SOIL is a tiny C library used primarily for uploading textures
into OpenGL.
'';
homepage = "https://www.lonesock.net/soil.html";
license = stdenv.lib.licenses.publicDomain;
platforms = stdenv.lib.platforms.linux;
license = licenses.publicDomain;
platforms = platforms.unix;
maintainers = with maintainers; [ r-burns ];
};
}

View File

@ -15704,7 +15704,9 @@ in
sofia_sip = callPackage ../development/libraries/sofia-sip { };
soil = callPackage ../development/libraries/soil { };
soil = callPackage ../development/libraries/soil {
inherit (darwin.apple_sdk.frameworks) Carbon;
};
sonic = callPackage ../development/libraries/sonic { };