so in order to build it, you need qt6 SDK
and I’m also not sure where to find /path/to/Qt/version/gcc_64
mentioned in this build command :
cmake -B build_dir -DCMAKE_PREFIX_PATH=/path/to/Qt/version/gcc_64
so my solution is just using ${pkgs.qt6.qmake}/Qt/6.6.1/gcc_64
, however, I’m unable to locate the exact path of it after using nix-locate
And I’m also not sure if using libsForQt5.callPackage
will affect the build process, even though i specify the buildInputs
and nativeBuildInputs
to to use qt6 with pkgs.qt6.
anyways, the build process is not at all successful and I’m having difficulty with it. Please help me.
#file: configuration.nix
environment.systemPackages = with pkgs; [
(libsForQt5.callPackage ./packages/caesium.nix{}).caesium
];
#file: ./packages/caesium.nix
{ lib, stdenv, pkgs, fetchFromGithub, ...}: #qtbase, wrapQtAppsHook, qmake, cmake... }:
{
caesium = stdenv.mkDerivation rec {
pname = "caesium-image-compressor";
version = "2.6.0";
dontBuild = true;
dontWrapQtApps = true;
src = pkgs.fetchFromGitHub {
owner = "Lymphatus";
repo = "caesium-image-compressor";
rev = "b7df29d37f17ec2d201f140adc76250931183221";
sha256 = "sha256-Rkedt8E7h8sbzBuOC2roSRogf9gizzgO3YImVqJN+60=";
};
buildInputs = with pkgs; [
qt6.qtbase
];
nativeBuildInputs = with pkgs; [
qt6.qmake
cmake
qt6.wrapQtAppsHook
cargo
];
buildPhase = ''
cmake -B $src -DCMAKE_PREFIX_PATH=${pkgs.qt6.qmake}/Qt/6.6.1/gcc_64
cmake --build $src --config Release --target caesium_image_compressor
'';
meta = with lib; {
description = "caesium-image-compressor";
homepage = "https://github.com/Lymphatus/caesium-image-compressor";
platforms = platforms.all;
maintainers = [ maintainers.Lymphatus ];
license = licenses.gpl3;
};
};
}
error log:
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/fhz3p6klpp8n3q5d6jjy5zg8ysriywgh-caesium-image-compressor-2.6.0.drv^*'
@nix { "action": "setPhase", "phase": "qmakePrePhase" }
Running phase: qmakePrePhase
@nix { "action": "setPhase", "phase": "qtPreHook" }
Running phase: qtPreHook
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/vddm2dq9da8b33nbnzs57awc7y8206zi-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
QMAKEPATH=/nix/store/k6bzgbksd210zbmazf1ax5f37nq9b92y-qtbase-5.15.12-dev:/nix/store/kzp3jyh2lrwxkvc1hhz8dxrxx6qbwzm5-qtwayland-5.15.12-dev:/nix/store/z8y7f2amviymk>
qmake PREFIX=/nix/store/68w9x2nfbcn4h6l7hgjqwg9z6ximdk0n-caesium-image-compressor-2.6.0 NIX_OUTPUT_OUT=/nix/store/68w9x2nfbcn4h6l7hgjqwg9z6ximdk0n-caesium-image-co>
Usage: qmake [mode] [options] [files]
QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project
Mode:
-project Put qmake into project file generation mode
In this mode qmake interprets [files] as files to
be added to the .pro file. By default, all files with
known source extensions are added.
Note: The created .pro file probably will
need to be edited. For example add the QT variable to
specify what modules are required.
-makefile Put qmake into makefile generation mode (default)
In this mode qmake interprets files as project files to
be processed, if skipped qmake will try to find a project
file in your current working directory
Warnings Options:
-Wnone Turn off all warnings; specific ones may be re-enabled by
later -W options
-Wall Turn on all warnings
-Wparser Turn on parser warnings
-Wlogic Turn on logic warnings (on by default)
-Wdeprecated Turn on deprecation warnings (on by default)
Options:
* You can place any variable assignment in options and it will be *
* processed as if it was in [files]. These assignments will be *
* processed before [files] by default. *
-o file Write output to file
-d Increase debug level
-t templ Overrides TEMPLATE as templ
-tp prefix Overrides TEMPLATE so that prefix is prefixed into the value
-help This help
-v Version information
-early All subsequent variable assignments will be
parsed right before default_pre.prf
-before All subsequent variable assignments will be
parsed right before [files] (the default)
-after All subsequent variable assignments will be
parsed after [files]
-late All subsequent variable assignments will be
parsed right after default_post.prf
-norecursive Don't do a recursive search
-recursive Do a recursive search
-set <prop> <value> Set persistent property
-unset <prop> Unset persistent property
-query <prop> Query persistent property. Show all if <prop> is empty.
-qtconf file Use file instead of looking for qt.conf
-cache file Use file as cache [makefile mode only]
-spec spec Use spec as QMAKESPEC [makefile mode only]
-nocache Don't use a cache file [makefile mode only]
-nodepend Don't generate dependencies [makefile mode only]
-nomoc Don't generate moc targets [makefile mode only]
-nopwd Don't look for files in pwd [project mode only]
The error log seems like i didn’t specify operands for qmake, even though i set dontBuild
to true and specify ``buildPhase` commands. I’m not quite sure what’s happenning