From 1692bf953eee63cfb782c91b4741e27d9ca6476b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 8 Jul 2022 00:22:09 +0800 Subject: [PATCH] trex: rename into cursedgl and update to 0.4.0 --- pkgs/cursedgl/default.nix | 26 ++++++++ pkgs/cursedgl/patches/update-cmakelist.patch | 64 ++++++++++++++++++++ pkgs/default.nix | 2 +- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 pkgs/cursedgl/default.nix create mode 100644 pkgs/cursedgl/patches/update-cmakelist.patch diff --git a/pkgs/cursedgl/default.nix b/pkgs/cursedgl/default.nix new file mode 100644 index 00000000..80ebf22a --- /dev/null +++ b/pkgs/cursedgl/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchFromGitHub, cmake, notcurses, ncurses }: + +stdenv.mkDerivation rec { + pname = "cursedgl"; + version = "0.4.0"; + + src = fetchFromGitHub { + owner = "saccharineboi"; + repo = "CursedGL"; + rev = "v${version}"; + sha256 = "sha256-h4gDF0yVbCEj4uE/QVg0WLmQuiRkFX1dHo0ULcYSVYg="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ ncurses notcurses ]; + + patches = [ + ./patches/update-cmakelist.patch + ]; + + meta = with lib; { + description = "Notcurses-based software rasterizer"; + homepage = "https://github.com/saccharineboi/CursedGL"; + license = licenses.gpl3; + }; +} diff --git a/pkgs/cursedgl/patches/update-cmakelist.patch b/pkgs/cursedgl/patches/update-cmakelist.patch new file mode 100644 index 00000000..4176925a --- /dev/null +++ b/pkgs/cursedgl/patches/update-cmakelist.patch @@ -0,0 +1,64 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7910d72..1775b43 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -63,54 +63,16 @@ set(HEADER_FILES ${CMAKE_SOURCE_DIR}/include/common.h + include_directories ( + "${CMAKE_SOURCE_DIR}/include" + ) ++install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + # build library + set(LIBS ${LIBS} notcurses-core m pthread) + add_library(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) ++install(TARGETS ${PROJECT_NAME}) + + # build examples +- +-# colored_cube +-set(EXAMPLE colored_cube) +-add_executable(${EXAMPLE} examples/colored_cube.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# interpolation +-set(EXAMPLE interpolation) +-add_executable(${EXAMPLE} examples/interpolation.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# hello_triangle +-set(EXAMPLE hello_triangle) +-add_executable(${EXAMPLE} examples/hello_triangle.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# teapot +-set(EXAMPLE teapot) ++foreach(EXAMPLE colored_cube interpolation hello_triangle teapot montecarlo hello_cube first_person_demo) + add_executable(${EXAMPLE} examples/teapot.c) + target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# montecarlo +-set(EXAMPLE montecarlo) +-add_executable(${EXAMPLE} examples/montecarlo.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# hello_cube +-set(EXAMPLE hello_cube) +-add_executable(${EXAMPLE} examples/hello_cube.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# first_person_demo +-set(EXAMPLE first_person_demo) +-add_executable(${EXAMPLE} examples/first_person_demo.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# hello_lines +-set(EXAMPLE hello_lines) +-add_executable(${EXAMPLE} examples/hello_lines.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) +- +-# usage +-set(EXAMPLE usage) +-add_executable(${EXAMPLE} examples/usage.c) +-target_link_libraries(${EXAMPLE} PUBLIC ${LIBS} ${PROJECT_NAME}) ++install(TARGETS ${EXAMPLE} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/examples") ++endforeach() diff --git a/pkgs/default.nix b/pkgs/default.nix index 65eb39f9..ec3d057b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -10,6 +10,7 @@ let auto-editor = callPackage ./auto-editor.nix { }; blueprint-compiler = callPackage ./blueprint-compiler.nix { }; butler = callPackage ./butler.nix { }; + cursedgl = callPackage ./cursedgl { }; clidle = callPackage ./clidle.nix { }; domterm = callPackage ./domterm { }; freerct = callPackage ./freerct.nix { }; @@ -42,7 +43,6 @@ let pop-launcher = callPackage ./pop-launcher.nix { }; pop-launcher-plugin-duckduckgo-bangs = callPackage ./pop-launcher-plugin-duckduckgo-bangs.nix { }; - #trex = callPackage ./trex.nix { }; text-engine = callPackage ./text-engine.nix { }; tic-80 = callPackage ./tic-80 { }; thokr = callPackage ./thokr.nix { };