nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1096B)


      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   src = fetchFromGitHub {
     17     owner = "lighttransport";
     18     repo = "objlab";
     19     rev = "c9d50b466f477722578ddf14565561d778c1b4b9";
     20     hash = "sha256-mE4s+viW6fGfnd8+LlDH4LyRLQ91nwe9dtxyI+dIhsM=";
     21   };
     22 
     23   postPatch = ''
     24     substituteInPlace CMakeLists.txt \
     25       --replace-fail "add_subdirectory" "#add_subdirectory"
     26   '';
     27 
     28   nativeBuildInputs = [ cmake ];
     29 
     30   buildInputs = [
     31     ghc_filesystem
     32     glfw
     33     libglvnd
     34     libGLU
     35   ];
     36 
     37   env.NIX_CFLAGS_COMPILE = "-fpermissive";
     38 
     39   cmakeFlags = [ (lib.cmakeFeature "OpenGL_GL_PREFERENCE" "GLVND") ];
     40 
     41   installPhase = ''
     42     install -Dm755 objlab -t $out/bin
     43   '';
     44 
     45   meta = {
     46     description = "Simple wavefront .obj viewer";
     47     homepage = "https://github.com/lighttransport/objlab";
     48     license = lib.licenses.mit;
     49     maintainers = [ lib.maintainers.sikmir ];
     50     platforms = lib.platforms.linux;
     51     skip.ci = stdenv.isDarwin;
     52     mainProgram = "objlab";
     53   };
     54 }