mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 06:01:15 +00:00
waifu2x-converter-cpp: Enable build on Darwin
This commit is contained in:
parent
4f5bc22ad7
commit
bf27bf0909
|
@ -1,4 +1,4 @@
|
|||
{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers
|
||||
{ cmake, fetchFromGitHub, makeWrapper, opencv3, lib, stdenv, ocl-icd, opencl-headers, OpenCL
|
||||
, cudaSupport ? false, cudatoolkit ? null
|
||||
}:
|
||||
|
||||
|
@ -13,13 +13,20 @@ stdenv.mkDerivation rec {
|
|||
sha256 = "0rv8bnyxz89za6gwk9gmdbaf3j7c1j52mip7h81rir288j35m84x";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Remove the hard-coded compiler on Darwin and use the one in stdenv.
|
||||
./waifu2x_darwin_build.diff
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
ocl-icd opencv3 opencl-headers
|
||||
] ++ lib.optional cudaSupport cudatoolkit;
|
||||
opencv3
|
||||
] ++ lib.optional cudaSupport cudatoolkit
|
||||
++ lib.optional stdenv.isDarwin OpenCL
|
||||
++ lib.optionals stdenv.isLinux [ ocl-icd opencl-headers ];
|
||||
|
||||
nativeBuildInputs = [ cmake makeWrapper ];
|
||||
|
||||
preFixup = ''
|
||||
preFixup = lib.optionalString stdenv.isLinux ''
|
||||
wrapProgram $out/bin/waifu2x-converter-cpp --prefix LD_LIBRARY_PATH : "${ocl-icd}/lib"
|
||||
'';
|
||||
|
||||
|
@ -28,6 +35,6 @@ stdenv.mkDerivation rec {
|
|||
homepage = "https://github.com/DeadSix27/waifu2x-converter-cpp";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [ lib.maintainers.xzfc ];
|
||||
platforms = lib.platforms.linux;
|
||||
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 8b728b5..dedf8b6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -71,10 +71,6 @@ message(STATUS "System is: ${CMAKE_SYSTEM_NAME} (${LOCAL_SYS_TYPE})")
|
||||
|
||||
### Get binary paths for APPLE users
|
||||
if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
|
||||
- set(CMAKE_C_COMPILER "/usr/local/opt/llvm/bin/clang")
|
||||
- set(CMAKE_CXX_COMPILER "/usr/local/opt/llvm/bin/clang++")
|
||||
- set(CMAKE_EXE_LINKER_FLAGS "-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib")
|
||||
- set(CMAKE_SHARED_LINKER_FLAGS "-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib")
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||
set(FILE_SYSTEM_LIB "c++fs")
|
||||
endif()
|
|
@ -9923,7 +9923,9 @@ with pkgs;
|
|||
openssl = openssl_1_0_2;
|
||||
};
|
||||
|
||||
waifu2x-converter-cpp = callPackage ../tools/graphics/waifu2x-converter-cpp { };
|
||||
waifu2x-converter-cpp = callPackage ../tools/graphics/waifu2x-converter-cpp {
|
||||
inherit (darwin.apple_sdk.frameworks) OpenCL;
|
||||
};
|
||||
|
||||
wakatime = pythonPackages.callPackage ../tools/misc/wakatime { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue