package.nix (1125B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 ghc_filesystem, 7 glfw, 8 libglvnd, 9 libGLU, 10 }: 11 12 stdenv.mkDerivation { 13 pname = "objlab"; 14 version = "0-unstable-2019-11-23"; 15 16 __structuredAttrs = true; 17 18 src = fetchFromGitHub { 19 owner = "lighttransport"; 20 repo = "objlab"; 21 rev = "c9d50b466f477722578ddf14565561d778c1b4b9"; 22 hash = "sha256-mE4s+viW6fGfnd8+LlDH4LyRLQ91nwe9dtxyI+dIhsM="; 23 }; 24 25 postPatch = '' 26 substituteInPlace CMakeLists.txt \ 27 --replace-fail "add_subdirectory" "#add_subdirectory" 28 ''; 29 30 nativeBuildInputs = [ cmake ]; 31 32 buildInputs = [ 33 ghc_filesystem 34 glfw 35 libglvnd 36 libGLU 37 ]; 38 39 env.NIX_CFLAGS_COMPILE = "-fpermissive"; 40 41 cmakeFlags = [ (lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND") ]; 42 43 installPhase = '' 44 install -Dm755 objlab -t $out/bin 45 ''; 46 47 meta = { 48 description = "Simple wavefront .obj viewer"; 49 homepage = "https://github.com/lighttransport/objlab"; 50 license = lib.licenses.mit; 51 maintainers = [ lib.maintainers.sikmir ]; 52 platforms = lib.platforms.linux; 53 skip.ci = stdenv.isDarwin; 54 mainProgram = "objlab"; 55 }; 56 }
