lol
1{ stdenv, lib
2, Carbon
3, fetchzip
4, libGL
5, libX11
6}:
7
8stdenv.mkDerivation {
9 name = "soil";
10
11 src = fetchzip {
12 url = "https://web.archive.org/web/20200104042737id_/http://www.lonesock.net/files/soil.zip";
13 sha256 = "1c05nwbnfdgwaz8ywn7kg2xrcvrcbpdyhcfkkiiwk69zvil0pbgd";
14 };
15
16 buildInputs = if stdenv.hostPlatform.isDarwin then [
17 Carbon
18 ] else [
19 libGL
20 libX11
21 ];
22
23 buildPhase = ''
24 cd src
25 $CC $NIX_CFLAGS_COMPILE -c *.c
26 $AR rcs libSOIL.a *.o
27 '';
28 installPhase = ''
29 mkdir -p $out/lib $out/include/SOIL
30 cp libSOIL.a $out/lib/
31 cp SOIL.h $out/include/SOIL/
32 '';
33
34 meta = with lib; {
35 description = "Simple OpenGL Image Library";
36 longDescription = ''
37 SOIL is a tiny C library used primarily for uploading textures
38 into OpenGL.
39 '';
40 homepage = "https://www.lonesock.net/soil.html";
41 license = licenses.publicDomain;
42 platforms = platforms.unix;
43 maintainers = with maintainers; [ r-burns ];
44 };
45}