Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / misc / drivers / epsonscan2 / build.patch
blob6a916511b84ab5bef5223c64be69d7e9a1e319e9
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index a9daee7..7c6da08 100755
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -17,7 +17,6 @@
6 # CMakeLists.txt -- template and derived ESC/I ESC/I-2 protocol commands
8 project (epsonscan2)
9 -set (CMAKE_INSTALL_PREFIX "/usr")
10 cmake_minimum_required (VERSION 2.8.12.2)
12 include(GNUInstallDirs)
13 @@ -86,7 +85,6 @@ set(COMMON_ETC_PATH ${CMAKE_INSTALL_FULL_SYSCONFDIR})
14 set(EPSON_WORK_PATH /tmp/epsonWork/)
15 set(EPSON_SETTINGS_PATH $ENV{HOME}/.epsonscan2/)
17 -SET (CMAKE_INSTALL_PREFIX /usr)
18 set(EPSON_INSTALL_PATH ${CMAKE_INSTALL_FULL_LIBDIR}/epsonscan2/)
19 set(COMMON_SHARE_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR})
21 @@ -113,8 +111,8 @@ add_subdirectory(src)
23 install(DIRECTORY Resources DESTINATION ${EPSON_INSTALL_ROOT}${EPSON_INSTALL_PATH})
25 -install(FILES epsonscan2.rules DESTINATION ${EPSON_INSTALL_ROOT}/lib/udev/rules.d/ RENAME 60-epsonscan2.rules)
26 -install(FILES epsonscan2 DESTINATION ${EPSON_INSTALL_ROOT}/etc/sane.d/dll.d)
27 +install(FILES epsonscan2.rules DESTINATION ${EPSON_INSTALL_ROOT}${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d/ RENAME 60-epsonscan2.rules)
28 +install(FILES epsonscan2 DESTINATION ${EPSON_INSTALL_ROOT}${CMAKE_INSTALL_PREFIX}/etc/sane.d/dll.d)
29 install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${EPSON_INSTALL_ROOT}${CMAKE_INSTALL_FULL_LIBDIR}/sane/)")
30 install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../epsonscan2/libsane-epsonscan2.so ${EPSON_INSTALL_ROOT}${CMAKE_INSTALL_FULL_LIBDIR}/sane/libsane-epsonscan2.so.1)")
31 install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../epsonscan2/libsane-epsonscan2.so ${EPSON_INSTALL_ROOT}${CMAKE_INSTALL_FULL_LIBDIR}/sane/libsane-epsonscan2.so.1.0.0)")
32 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
33 index c884d83..5ddff0c 100644
34 --- a/src/CMakeLists.txt
35 +++ b/src/CMakeLists.txt
36 @@ -26,7 +26,9 @@ add_subdirectory(ES2Command/Linux)
37 add_subdirectory(ES2FileFormat/Linux)
38 add_subdirectory(Controller)
39 add_subdirectory(SaneWrapper/Linux)
40 +if (NOT DEFINED NO_GUI)
41 add_subdirectory(Standalone)
42 add_subdirectory(DetectAlert)
43 +endif ()
44 add_subdirectory(ScanSDK)
46 diff --git a/src/Controller/Src/Filter/GetOrientation.cpp b/src/Controller/Src/Filter/GetOrientation.cpp
47 index 387561e..15448ad 100644
48 --- a/src/Controller/Src/Filter/GetOrientation.cpp
49 +++ b/src/Controller/Src/Filter/GetOrientation.cpp
50 @@ -12,14 +12,7 @@ namespace epsonscan
52 static std::string GetExecPath()
54 -#ifdef AKBMODE
55 - std::string strDst = "/usr/libexec/";
56 - strDst = strDst + DRIVER_NAME;
57 - strDst = strDst + "-ocr/ocr-engine-getrotate";
58 - return strDst.c_str() ;
59 -#else
60 - return "/usr/libexec/epsonscan2-ocr/ocr-engine-getrotate" ;
61 -#endif
62 + return "@OCR_ENGINE_GETROTATE@";
64 static const int kMaxBuf = 256;
66 diff --git a/src/Controller/Src/Scanner/Engine.cpp b/src/Controller/Src/Scanner/Engine.cpp
67 index 9489d4b..670bad9 100644
68 --- a/src/Controller/Src/Scanner/Engine.cpp
69 +++ b/src/Controller/Src/Scanner/Engine.cpp
70 @@ -263,8 +263,8 @@ SDIError Engine::Open()
71 //kill es2netif
72 //kill es2intif
74 - system("killall -9 -q es2netif > /dev/null");
75 - system("killall -9 -q es2intif > /dev/null");
76 + system("@KILLALL@ -9 -q es2netif > /dev/null");
77 + system("@KILLALL@ -9 -q es2intif > /dev/null");
79 if (engine_) {
80 return ExchangeError(engine_->Open());
81 diff --git a/src/Standalone/CMakeLists.txt b/src/Standalone/CMakeLists.txt
82 index eff3dd3..c2b3803 100644
83 --- a/src/Standalone/CMakeLists.txt
84 +++ b/src/Standalone/CMakeLists.txt
85 @@ -167,5 +167,5 @@ target_link_libraries(es2standalone ${QT_LIBRARIES}
88 QT5_USE_MODULES(es2standalone Widgets)
89 -install(TARGETS es2standalone DESTINATION "${EPSON_INSTALL_ROOT}/usr/bin")
90 +install(TARGETS es2standalone DESTINATION "${EPSON_INSTALL_ROOT}${CMAKE_INSTALL_FULL_BINDIR}")