Merge pull request #216738 from wineee/deepin-camera
deepin.deepin-camera: init at 1.4.8
This commit is contained in:
commit
94dc2f4beb
95
pkgs/desktops/deepin/apps/deepin-camera/default.nix
Normal file
95
pkgs/desktops/deepin/apps/deepin-camera/default.nix
Normal file
|
@ -0,0 +1,95 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, pkg-config
|
||||
, qttools
|
||||
, wrapQtAppsHook
|
||||
, dtkwidget
|
||||
, qt5integration
|
||||
, qt5platform-plugins
|
||||
, image-editor
|
||||
, qtbase
|
||||
, qtmultimedia
|
||||
, ffmpeg
|
||||
, ffmpegthumbnailer
|
||||
, libusb1
|
||||
, portaudio
|
||||
, libv4l
|
||||
, gst_all_1
|
||||
, systemd
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "deepin-camera";
|
||||
version = "1.4.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "linuxdeepin";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-p2RCetx1lgLonXZaC3umE+nDgZnp64o3iR2MgQhbisM=";
|
||||
};
|
||||
|
||||
# QLibrary and dlopen work with LD_LIBRARY_PATH
|
||||
patches = [ ./dont_use_libPath.diff ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/CMakeLists.txt \
|
||||
--replace "/usr/share/libimagevisualresult/filter_cube" "${image-editor}/share/libimagevisualresult/filter_cube" \
|
||||
--replace "/usr/include/libusb-1.0" "${lib.getDev libusb1}/include/libusb-1.0"
|
||||
substituteInPlace src/com.deepin.Camera.service \
|
||||
--replace "/usr/bin/qdbus" "${lib.getBin qttools}/bin/qdbus" \
|
||||
--replace "/usr/share/applications/deepin-camera.desktop" "$out/share/applications/deepin-camera.desktop"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
qttools
|
||||
wrapQtAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
dtkwidget
|
||||
qt5platform-plugins
|
||||
image-editor
|
||||
qtbase
|
||||
qtmultimedia
|
||||
ffmpeg
|
||||
ffmpegthumbnailer
|
||||
libusb1
|
||||
portaudio
|
||||
libv4l
|
||||
] ++ (with gst_all_1 ; [
|
||||
gstreamer
|
||||
gst-plugins-base
|
||||
gst-plugins-good
|
||||
gst-plugins-bad
|
||||
]);
|
||||
|
||||
cmakeFlags = [ "-DVERSION=${version}" ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = [
|
||||
"-I${gst_all_1.gstreamer.dev}/include/gstreamer-1.0"
|
||||
"-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0"
|
||||
];
|
||||
|
||||
# qt5integration must be placed before qtsvg in QT_PLUGIN_PATH
|
||||
qtWrapperArgs = [
|
||||
"--prefix QT_PLUGIN_PATH : ${qt5integration}/${qtbase.qtPluginPrefix}"
|
||||
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ ffmpeg ffmpegthumbnailer gst_all_1.gstreamer gst_all_1.gst-plugins-base libusb1 libv4l portaudio systemd ]}"
|
||||
];
|
||||
|
||||
preFixup = ''
|
||||
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Tool to view camera, take photo and video";
|
||||
homepage = "https://github.com/linuxdeepin/deepin-camera";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = teams.deepin.members;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
diff --git a/src/src/mainwindow.cpp b/src/src/mainwindow.cpp
|
||||
index d3c6f5c..4817446 100644
|
||||
--- a/src/src/mainwindow.cpp
|
||||
+++ b/src/src/mainwindow.cpp
|
||||
@@ -781,19 +781,7 @@ void CMainWindow::slotPopupSettingsDialog()
|
||||
|
||||
QString CMainWindow::libPath(const QString &strlib)
|
||||
{
|
||||
- QDir dir;
|
||||
- QString path = QLibraryInfo::location(QLibraryInfo::LibrariesPath);
|
||||
- dir.setPath(path);
|
||||
- QStringList list = dir.entryList(QStringList() << (strlib + "*"), QDir::NoDotAndDotDot | QDir::Files); //filter name with strlib
|
||||
-
|
||||
- if (list.contains(strlib))
|
||||
- return strlib;
|
||||
-
|
||||
- list.sort();
|
||||
- if (list.size() > 0)
|
||||
- return list.last();
|
||||
-
|
||||
- return "";
|
||||
+ return strlib;
|
||||
}
|
||||
|
||||
void CMainWindow::reflushSnapshotLabel()
|
|
@ -37,6 +37,7 @@ let
|
|||
#### Dtk Application
|
||||
deepin-album = callPackage ./apps/deepin-album { };
|
||||
deepin-calculator = callPackage ./apps/deepin-calculator { };
|
||||
deepin-camera = callPackage ./apps/deepin-camera { };
|
||||
deepin-compressor = callPackage ./apps/deepin-compressor { };
|
||||
deepin-draw = callPackage ./apps/deepin-draw { };
|
||||
deepin-editor = callPackage ./apps/deepin-editor { };
|
||||
|
|
Loading…
Reference in a new issue