diff --git a/doc/languages-frameworks/lua.section.md b/doc/languages-frameworks/lua.section.md index 92ce8af1331b..2ed02ab9d6c7 100644 --- a/doc/languages-frameworks/lua.section.md +++ b/doc/languages-frameworks/lua.section.md @@ -129,16 +129,21 @@ Let's present the luarocks way first and the manual one in a second time. ### Packaging a library on luarocks {#packaging-a-library-on-luarocks} [Luarocks.org](https://luarocks.org/) is the main repository of lua packages. -The site proposes two types of packages, the rockspec and the src.rock +The site proposes two types of packages, the `rockspec` and the `src.rock` (equivalent of a [rockspec](https://github.com/luarocks/luarocks/wiki/Rockspec-format) but with the source). -These packages can have different build types such as `cmake`, `builtin` etc . -Luarocks-based packages are generated in pkgs/development/lua-modules/generated-packages.nix from -the whitelist maintainers/scripts/luarocks-packages.csv and updated by running maintainers/scripts/update-luarocks-packages. +Luarocks-based packages are generated in [pkgs/development/lua-modules/generated-packages.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/generated-packages.nix) from +the whitelist maintainers/scripts/luarocks-packages.csv and updated by running +the script +[maintainers/scripts/update-luarocks-packages](https://github.com/NixOS/nixpkgs/tree/master/maintainers/scripts/update-luarocks-packages): + +```sh +./maintainers/scripts/update-luarocks-packages update +``` [luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock). The automation only goes so far though and some packages need to be customized. -These customizations go in `pkgs/development/lua-modules/overrides.nix`. +These customizations go in [pkgs/development/lua-modules/overrides.nix](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/lua-modules/overrides.nix). For instance if the rockspec defines `external_dependencies`, these need to be manually added to the overrides.nix. You can try converting luarocks packages to nix packages with the command `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`. diff --git a/doc/languages-frameworks/vim.section.md b/doc/languages-frameworks/vim.section.md index 39e38c6a123d..bf0d663179b9 100644 --- a/doc/languages-frameworks/vim.section.md +++ b/doc/languages-frameworks/vim.section.md @@ -212,7 +212,7 @@ Note: this is not possible anymore for Neovim. ## Adding new plugins to nixpkgs {#adding-new-plugins-to-nixpkgs} -Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]@[gitref]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`. +Nix expressions for Vim plugins are stored in [pkgs/applications/editors/vim/plugins](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/vim/plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py). This creates a [generated.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/vim-plugin-names). After running `./update.py`, if nvim-treesitter received an update, also run [`nvim-treesitter/update.py`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/update.py) to update the tree sitter grammars for `nvim-treesitter`. @@ -226,7 +226,7 @@ deoplete-fish = super.deoplete-fish.overrideAttrs(old: { Sometimes plugins require an override that must be changed when the plugin is updated. This can cause issues when Vim plugins are auto-updated but the associated override isn't updated. For these plugins, the override should be written so that it specifies all information required to install the plugin, and running `./update.py` doesn't change the derivation for the plugin. Manually updating the override is required to update these types of plugins. An example of such a plugin is `LanguageClient-neovim`. -To add a new plugin, run `./update.py --add "[owner]/[name]"`. **NOTE**: This script automatically commits to your git repository. Be sure to check out a fresh branch before running. +To add a new plugin, run `./update.py add "[owner]/[name]"`. **NOTE**: This script automatically commits to your git repository. Be sure to check out a fresh branch before running. Finally, there are some plugins that are also packaged in nodePackages because they have Javascript-related build steps, such as running webpack. Those plugins are not listed in `vim-plugin-names` or managed by `update.py` at all, and are included separately in `overrides.nix`. Currently, all these plugins are related to the `coc.nvim` ecosystem of the Language Server Protocol integration with Vim/Neovim. diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index fa8d1ad6486a..ab30cecaa46b 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -14752,6 +14752,12 @@ githubId = 187109; name = "Bjarki Ágúst Guðmundsson"; }; + surfaceflinger = { + email = "nat@nekopon.pl"; + github = "surfaceflinger"; + githubId = 44725111; + name = "nat"; + }; suryasr007 = { email = "94suryateja@gmail.com"; github = "suryasr007"; diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py index 3341fea29106..7c6cfd4fed7f 100644 --- a/maintainers/scripts/pluginupdate.py +++ b/maintainers/scripts/pluginupdate.py @@ -1,4 +1,7 @@ -# Used by pkgs/applications/editors/vim/plugins/update.py and pkgs/applications/editors/kakoune/plugins/update.py +# python library used to update plugins: +# - pkgs/applications/editors/vim/plugins/update.py +# - pkgs/applications/editors/kakoune/plugins/update.py +# - maintainers/scripts/update-luarocks-packages # format: # $ nix run nixpkgs.python3Packages.black -c black update.py @@ -315,10 +318,10 @@ def run_nix_expr(expr): with CleanEnvironment(): cmd = ["nix", "eval", "--extra-experimental-features", "nix-command", "--impure", "--json", "--expr", expr] - log.debug("Running command %s", cmd) + log.debug("Running command %s", " ".join(cmd)) out = subprocess.check_output(cmd) - data = json.loads(out) - return data + data = json.loads(out) + return data class Editor: @@ -344,12 +347,39 @@ class Editor: self.cache_file = cache_file or f"{name}-plugin-cache.json" self.nixpkgs_repo = None + def add(self, args): + '''CSV spec''' + log.debug("called the 'add' command") + fetch_config = FetchConfig(args.proc, args.github_token) + editor = self + for plugin_line in args.add_plugins: + log.debug("using plugin_line", plugin_line) + pdesc = PluginDesc.load_from_string(fetch_config, plugin_line) + log.debug("loaded as pdesc", pdesc) + append = [ pdesc ] + editor.rewrite_input(fetch_config, args.input_file, editor.deprecated, append=append) + plugin, _ = prefetch_plugin(pdesc, ) + autocommit = not args.no_commit + if autocommit: + commit( + editor.nixpkgs_repo, + "{drv_name}: init at {version}".format( + drv_name=editor.get_drv_name(plugin.normalized_name), + version=plugin.version + ), + [args.outfile, args.input_file], + ) + + # Expects arguments generated by 'update' subparser + def update(self, args ): + '''CSV spec''' + print("the update member function should be overriden in subclasses") + def get_current_plugins(self) -> List[Plugin]: """To fill the cache""" data = run_nix_expr(self.get_plugins) plugins = [] for name, attr in data.items(): - print("get_current_plugins: name %s" % name) p = Plugin(name, attr["rev"], attr["submodules"], attr["sha256"]) plugins.append(p) return plugins @@ -358,7 +388,7 @@ class Editor: '''CSV spec''' return load_plugins_from_csv(config, plugin_file) - def generate_nix(self, plugins, outfile: str): + def generate_nix(self, _plugins, _outfile: str): '''Returns nothing for now, writes directly to outfile''' raise NotImplementedError() @@ -395,34 +425,28 @@ class Editor: return rewrite_input(*args, **kwargs) def create_parser(self): - parser = argparse.ArgumentParser( + common = argparse.ArgumentParser( + add_help=False, description=(f""" Updates nix derivations for {self.name} plugins.\n By default from {self.default_in} to {self.default_out}""" ) ) - parser.add_argument( - "--add", - dest="add_plugins", - default=[], - action="append", - help=f"Plugin to add to {self.attr_path} from Github in the form owner/repo", - ) - parser.add_argument( + common.add_argument( "--input-names", "-i", dest="input_file", default=self.default_in, help="A list of plugins in the form owner/repo", ) - parser.add_argument( + common.add_argument( "--out", "-o", dest="outfile", default=self.default_out, help="Filename to save generated nix code", ) - parser.add_argument( + common.add_argument( "--proc", "-p", dest="proc", @@ -430,7 +454,7 @@ class Editor: default=30, help="Number of concurrent processes to spawn. Setting --github-token allows higher values.", ) - parser.add_argument( + common.add_argument( "--github-token", "-t", type=str, @@ -438,16 +462,61 @@ class Editor: help="""Allows to set --proc to higher values. Uses GITHUB_API_TOKEN environment variables as the default value.""", ) - parser.add_argument( + common.add_argument( "--no-commit", "-n", action="store_true", default=False, help="Whether to autocommit changes" ) - parser.add_argument( + common.add_argument( "--debug", "-d", choices=LOG_LEVELS.keys(), default=logging.getLevelName(logging.WARN), help="Adjust log level" ) - return parser + + main = argparse.ArgumentParser( + parents=[common], + description=(f""" + Updates nix derivations for {self.name} plugins.\n + By default from {self.default_in} to {self.default_out}""" + ) + ) + + subparsers = main.add_subparsers(dest="command", required=False) + padd = subparsers.add_parser( + "add", parents=[], + description="Add new plugin", + add_help=False, + ) + padd.set_defaults(func=self.add) + padd.add_argument( + "add_plugins", + default=None, + nargs="+", + help=f"Plugin to add to {self.attr_path} from Github in the form owner/repo", + ) + + pupdate = subparsers.add_parser( + "update", + description="Update all or a subset of existing plugins", + add_help=False, + ) + pupdate.set_defaults(func=self.update) + return main + + def run(self,): + ''' + Convenience function + ''' + parser = self.create_parser() + args = parser.parse_args() + command = args.command or "update" + log.setLevel(LOG_LEVELS[args.debug]) + log.info("Chose to run command: %s", command) + + if not args.no_commit: + self.nixpkgs_repo = git.Repo(self.root, search_parent_directories=True) + + getattr(self, command)(args) + @@ -661,7 +730,6 @@ def commit(repo: git.Repo, message: str, files: List[Path]) -> None: def update_plugins(editor: Editor, args): """The main entry function of this module. All input arguments are grouped in the `Editor`.""" - log.setLevel(LOG_LEVELS[args.debug]) log.info("Start updating plugins") fetch_config = FetchConfig(args.proc, args.github_token) update = editor.get_update(args.input_file, args.outfile, fetch_config) @@ -684,18 +752,3 @@ def update_plugins(editor: Editor, args): [args.outfile, args.input_file, editor.deprecated], ) - for plugin_line in args.add_plugins: - pdesc = PluginDesc.load_from_string(fetch_config, plugin_line) - append = [ pdesc ] - editor.rewrite_input(fetch_config, args.input_file, editor.deprecated, append=append) - update() - plugin, _ = prefetch_plugin(pdesc, ) - if autocommit: - commit( - editor.nixpkgs_repo, - "{drv_name}: init at {version}".format( - drv_name=editor.get_drv_name(plugin.normalized_name), - version=plugin.version - ), - [args.outfile, args.input_file], - ) diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages index f34aa53626da..0e1e188e0b33 100755 --- a/maintainers/scripts/update-luarocks-packages +++ b/maintainers/scripts/update-luarocks-packages @@ -203,11 +203,7 @@ def main(): default_out = ROOT.joinpath(GENERATED_NIXFILE) ) - parser = editor.create_parser() - args = parser.parse_args() - - update_plugins(editor, args) - + editor.run() if __name__ == "__main__": diff --git a/nixos/tests/cage.nix b/nixos/tests/cage.nix index 39c8d0441b6d..db1b7854673d 100644 --- a/nixos/tests/cage.nix +++ b/nixos/tests/cage.nix @@ -10,11 +10,13 @@ import ./make-test-python.nix ({ pkgs, ...} : { imports = [ ./common/user-account.nix ]; + + fonts.fonts = with pkgs; [ dejavu_fonts ]; + services.cage = { enable = true; user = "alice"; - # Disable color and bold and use a larger font to make OCR easier: - program = "${pkgs.xterm}/bin/xterm -cm -pc -fa Monospace -fs 24"; + program = "${pkgs.xterm}/bin/xterm"; }; # Need to switch to a different GPU driver than the default one (-vga std) so that Cage can launch: diff --git a/pkgs/applications/editors/kakoune/plugins/update.py b/pkgs/applications/editors/kakoune/plugins/update.py index 49662a0e8e2e..ab5aa9242839 100755 --- a/pkgs/applications/editors/kakoune/plugins/update.py +++ b/pkgs/applications/editors/kakoune/plugins/update.py @@ -81,10 +81,7 @@ in lib.fix' (lib.extends overrides packages) def main(): editor = KakouneEditor("kakoune", ROOT, GET_PLUGINS) - parser = editor.create_parser() - args = parser.parse_args() - - pluginupdate.update_plugins(editor, args) + editor.run() if __name__ == "__main__": diff --git a/pkgs/applications/editors/vim/plugins/get-plugins.nix b/pkgs/applications/editors/vim/plugins/get-plugins.nix new file mode 100644 index 000000000000..0aaec333c2d7 --- /dev/null +++ b/pkgs/applications/editors/vim/plugins/get-plugins.nix @@ -0,0 +1,19 @@ +with import {}; +let + inherit (vimUtils.override {inherit vim;}) buildVimPluginFrom2Nix; + inherit (neovimUtils) buildNeovimPluginFrom2Nix; + + generated = callPackage { + inherit buildNeovimPluginFrom2Nix buildVimPluginFrom2Nix; + } {} {}; + hasChecksum = value: + lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value; + getChecksum = name: value: + if hasChecksum value then { + submodules = value.src.fetchSubmodules or false; + sha256 = value.src.outputHash; + rev = value.src.rev; + } else null; + checksums = lib.mapAttrs getChecksum generated; +in + lib.filterAttrs (n: v: v != null) checksums diff --git a/pkgs/applications/editors/vim/plugins/update.py b/pkgs/applications/editors/vim/plugins/update.py index 20336c66ed6e..09606634f9e5 100755 --- a/pkgs/applications/editors/vim/plugins/update.py +++ b/pkgs/applications/editors/vim/plugins/update.py @@ -42,28 +42,14 @@ sys.path.insert(0, os.path.join(ROOT.parent.parent.parent.parent.parent, "mainta import pluginupdate from pluginupdate import run_nix_expr, PluginDesc -GET_PLUGINS = f"""(with import {{}}; -let - inherit (vimUtils.override {{inherit vim;}}) buildNeovimPluginFrom2Nix buildVimPluginFrom2Nix; - generated = callPackage {ROOT}/generated.nix {{ - inherit buildNeovimPluginFrom2Nix buildVimPluginFrom2Nix; - }}; - hasChecksum = value: lib.isAttrs value && lib.hasAttrByPath ["src" "outputHash"] value; - getChecksum = name: value: - if hasChecksum value then {{ - submodules = value.src.fetchSubmodules or false; - sha256 = value.src.outputHash; - rev = value.src.rev; - }} else null; - checksums = lib.mapAttrs getChecksum generated; -in lib.filterAttrs (n: v: v != null) checksums)""" + GET_PLUGINS_LUA = """ with import {}; lib.attrNames lua51Packages""" HEADER = ( - "# This file has been generated by ./pkgs/applications/editors/vim/plugins/update.py. Do not edit!" + "# GENERATED by ./pkgs/applications/editors/vim/plugins/update.py. Do not edit!" ) def isNeovimPlugin(plug: pluginupdate.Plugin) -> bool: @@ -118,34 +104,39 @@ class VimEditor(pluginupdate.Editor): """.format( buildFn="buildNeovimPluginFrom2Nix" if isNeovim else "buildVimPluginFrom2Nix", plugin=plugin, src_nix=src_nix, repo=repo) - print(content) + log.debug(content) return content + + def update(self, args): + pluginupdate.update_plugins(self, args) + + if self.nvim_treesitter_updated: + print("updating nvim-treesitter grammars") + nvim_treesitter_dir = ROOT.joinpath("nvim-treesitter") + subprocess.check_call([nvim_treesitter_dir.joinpath("update.py")]) + + if self.nixpkgs_repo: + index = self.nixpkgs_repo.index + for diff in index.diff(None): + if diff.a_path == "pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix": + msg = "vimPlugins.nvim-treesitter: update grammars" + print(f"committing to nixpkgs: {msg}") + index.add([str(nvim_treesitter_dir.joinpath("generated.nix"))]) + index.commit(msg) + return + print("no updates to nvim-treesitter grammars") + + def main(): global luaPlugins luaPlugins = run_nix_expr(GET_PLUGINS_LUA) + with open(f"{ROOT}/get-plugins.nix") as f: + GET_PLUGINS = f.read() editor = VimEditor("vim", ROOT, GET_PLUGINS) - parser = editor.create_parser() - args = parser.parse_args() - pluginupdate.update_plugins(editor, args) - - if editor.nvim_treesitter_updated: - print("updating nvim-treesitter grammars") - nvim_treesitter_dir = ROOT.joinpath("nvim-treesitter") - subprocess.check_call([nvim_treesitter_dir.joinpath("update.py")]) - - if editor.nixpkgs_repo: - index = editor.nixpkgs_repo.index - for diff in index.diff(None): - if diff.a_path == "pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix": - msg = "vimPlugins.nvim-treesitter: update grammars" - print(f"committing to nixpkgs: {msg}") - index.add([str(nvim_treesitter_dir.joinpath("generated.nix"))]) - index.commit(msg) - return - print("no updates to nvim-treesitter grammars") + editor.run() if __name__ == "__main__": diff --git a/pkgs/applications/misc/girara/default.nix b/pkgs/applications/misc/girara/default.nix index a6736c7a2dd3..20ea300d127c 100644 --- a/pkgs/applications/misc/girara/default.nix +++ b/pkgs/applications/misc/girara/default.nix @@ -43,6 +43,7 @@ stdenv.mkDerivation rec { gettext check dbus + glib # for glib-compile-resources ]; buildInputs = [ @@ -64,6 +65,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Ddocs=disabled" # docs do not seem to be installed + (lib.mesonEnable "tests" (stdenv.buildPlatform.canExecute stdenv.hostPlatform)) ]; checkPhase = '' diff --git a/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix b/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix index 649259dc7437..b352f4b7322f 100644 --- a/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix +++ b/pkgs/applications/networking/instant-messengers/signalbackup-tools/default.nix @@ -2,13 +2,13 @@ (if stdenv.isDarwin then darwin.apple_sdk_11_0.clang14Stdenv else stdenv).mkDerivation rec { pname = "signalbackup-tools"; - version = "20230413"; + version = "20230414"; src = fetchFromGitHub { owner = "bepaald"; repo = pname; rev = version; - hash = "sha256-7jIltC7YlnsvwADwKItFKKw5LUKDHux+b7frZfcNDyE="; + hash = "sha256-0pCItZCYdwX/Bl20HHc/FhIF4ZHsqz9aadfFYNdQ71M="; }; postPatch = '' diff --git a/pkgs/build-support/setup-hooks/move-build-tree.sh b/pkgs/build-support/setup-hooks/move-build-tree.sh new file mode 100644 index 000000000000..2718070f3933 --- /dev/null +++ b/pkgs/build-support/setup-hooks/move-build-tree.sh @@ -0,0 +1,12 @@ +prePhases+=" moveBuildDir" + +moveBuildDir() { + mkdir -p $out/.build + cd $out/.build +} + +postPhases+=" removeBuildDir" + +removeBuildDir() { + rm -rf $out/.build +} diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index 3b2979d3abce..70083fe56f4b 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -54,6 +54,13 @@ let ]; qtscript = [ ./qtscript.patch ]; qtserialport = [ ./qtserialport.patch ]; + qtsystems = [ + # Enable building with udisks support + (fetchpatch { + url = "https://salsa.debian.org/qt-kde-team/qt/qtsystems/-/raw/a23fd92222c33479d7f3b59e48116def6b46894c/debian/patches/2001_build_with_udisk.patch"; + hash = "sha256-B/z/+tai01RU/bAJSCp5a0/dGI8g36nwso8MiJv27YM="; + }) + ]; qtwebengine = [ (fetchpatch { url = "https://raw.githubusercontent.com/Homebrew/formula-patches/a6f16c6daea3b5a1f7bc9f175d1645922c131563/qt5/qt5-webengine-python3.patch"; @@ -166,6 +173,7 @@ let qtserialport = callPackage ../modules/qtserialport.nix {}; qtspeech = callPackage ../modules/qtspeech.nix {}; qtsvg = callPackage ../modules/qtsvg.nix {}; + qtsystems = callPackage ../modules/qtsystems.nix {}; qtscxml = callPackage ../modules/qtscxml.nix {}; qttools = callPackage ../modules/qttools.nix {}; qttranslations = callPackage ../modules/qttranslations.nix {}; diff --git a/pkgs/development/libraries/qt-5/5.15/srcs.nix b/pkgs/development/libraries/qt-5/5.15/srcs.nix index fad70cdcc7ee..b939b90afb9e 100644 --- a/pkgs/development/libraries/qt-5/5.15/srcs.nix +++ b/pkgs/development/libraries/qt-5/5.15/srcs.nix @@ -34,6 +34,17 @@ lib.mapAttrs mk (lib.importJSON ./srcs-generated.json) version = "5.212.0-alpha4"; }; + # qtsystems has no official releases + qtsystems = { + version = "unstable-2019-01-03"; + src = fetchFromGitHub { + owner = "qt"; + repo = "qtsystems"; + rev = "e3332ee38d27a134cef6621fdaf36687af1b6f4a"; + hash = "sha256-P8MJgWiDDBCYo+icbNva0LODy0W+bmQTS87ggacuMP0="; + }; + }; + catapult = fetchgit { url = "https://chromium.googlesource.com/catapult"; rev = "5eedfe23148a234211ba477f76fc2ea2e8529189"; diff --git a/pkgs/development/libraries/qt-5/modules/qtsystems.nix b/pkgs/development/libraries/qt-5/modules/qtsystems.nix new file mode 100644 index 000000000000..32974bdecc67 --- /dev/null +++ b/pkgs/development/libraries/qt-5/modules/qtsystems.nix @@ -0,0 +1,54 @@ +{ qtModule +, stdenv +, lib +, bluez +, libevdev +, libX11 +, pkg-config +, qtbase +, udev +, wrapQtAppsHook +}: + +qtModule { + pname = "qtsystems"; + + outputs = [ + "out" + "dev" + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ + "bin" + ]; + + qtInputs = [ + qtbase + ]; + + nativeBuildInputs = [ + pkg-config + wrapQtAppsHook + ]; + + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + bluez + libevdev + libX11 + udev + ]; + + qmakeFlags = [ + "CONFIG+=git_build" + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ + "CONFIG+=ofono" + "CONFIG+=udisks" + "CONFIG+=upower" + ]; + + postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' + wrapQtApp $bin/bin/servicefw + ''; + + meta = { + maintainers = with lib.maintainers; [ OPNA2608 ]; + }; +} diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index c608e859d10f..68481b65a145 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -5,7 +5,6 @@ , fetchpatch , makeSetupHook , makeWrapper -, cmake , gst_all_1 , libglvnd , darwin @@ -27,11 +26,6 @@ let callPackage = self.newScope ({ inherit qtModule srcs; stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; - cmake = cmake.overrideAttrs (attrs: { - patches = attrs.patches ++ [ - ./patches/cmake.patch - ]; - }); }); in { @@ -44,18 +38,15 @@ let withGtk3 = true; inherit (srcs.qtbase) src version; inherit developerBuild; - inherit (darwin.apple_sdk_11_0.frameworks) AGL AVFoundation AppKit GSS MetalKit; + inherit (darwin.apple_sdk_11_0.frameworks) + AGL AVFoundation AppKit Contacts CoreBluetooth EventKit GSS MetalKit; patches = [ - ./patches/qtbase-qmake-mkspecs-mac.patch - ./patches/qtbase-qmake-pkg-config.patch - ./patches/qtbase-tzdir.patch - ./patches/qtbase-variable-fonts.patch - # Remove symlink check causing build to bail out and fail. - # https://gitlab.kitware.com/cmake/cmake/-/issues/23251 - (fetchpatch { - url = "https://github.com/Homebrew/formula-patches/raw/c363f0edf9e90598d54bc3f4f1bacf95abbda282/qt/qt_internal_check_if_path_has_symlinks.patch"; - sha256 = "sha256-Gv2L8ymZSbJxcmUijKlT2NnkIB3bVH9D7YSsDX2noTU="; - }) + ./patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch + ./patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch + ./patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch + ./patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch + ./patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch + ./patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch ]; }; env = callPackage ./qt-env.nix { }; diff --git a/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh b/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh index 0fd0aee7dbf9..d6f8ab32f799 100644 --- a/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh +++ b/pkgs/development/libraries/qt-6/hooks/fix-qt-builtin-paths.sh @@ -7,9 +7,6 @@ fixQtBuiltinPaths() { local dir="$1" local pattern="$2" - local bin="${!outputBin}" - local dev="${!outputDev}" - local doc="${!outputDoc}" local lib="${!outputLib}" if [ -d "$dir" ]; then @@ -17,48 +14,48 @@ fixQtBuiltinPaths() { if grep -q '\$\$\[QT_' "${pr_:?}"; then echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${pr_:?}'..." sed -i "${pr_:?}" \ - -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$dev/bin|g" \ - -e "s|\\\$\\\$\\[QT_HOST_LIBEXECS[^]]*\\]|$dev/libexec|g" \ - -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$dev/mkspecs|g" \ - -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$dev|g" \ + -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$lib/bin|g" \ + -e "s|\\\$\\\$\\[QT_HOST_LIBEXECS[^]]*\\]|$lib/libexec|g" \ + -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$lib/mkspecs|g" \ + -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$lib|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$bin/bin|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$bin|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$lib/bin|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$lib|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$doc/share/doc|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$doc/examples|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$dev/include|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$lib/share/doc|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$lib/examples|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$lib/include|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$bin/$qtPluginPrefix|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$lib/$qtPluginPrefix|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|$lib|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$dev/tests|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$lib/tests|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$bin/$qtQmlPrefix|g" + -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$lib/$qtQmlPrefix|g" fi done elif [ -e "$dir" ]; then if grep -q '\$\$\[QT_' "${dir:?}"; then echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${dir:?}'..." sed -i "${dir:?}" \ - -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$dev/bin|g" \ - -e "s|\\\$\\\$\\[QT_HOST_LIBEXECS[^]]*\\]|$dev/libexec|g" \ - -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$dev/mkspecs|g" \ - -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$dev|g" \ + -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$lib/bin|g" \ + -e "s|\\\$\\\$\\[QT_HOST_LIBEXECS[^]]*\\]|$lib/libexec|g" \ + -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$lib/mkspecs|g" \ + -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$lib|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$bin/bin|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$bin|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$lib/bin|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$lib|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$doc/share/doc|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$doc/examples|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$dev/include|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$lib/share/doc|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$lib/examples|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$lib/include|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$bin/$qtPluginPrefix|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$lib/$qtPluginPrefix|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|$lib|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$dev/tests|g" \ + -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$lib/tests|g" \ -e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \ - -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$bin/$qtQmlPrefix|g" + -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$lib/$qtQmlPrefix|g" fi else echo "fixQtBuiltinPaths: Warning: \`$dir' does not exist" diff --git a/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh b/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh index 0a0e0d51e27d..4884f45b9930 100644 --- a/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh +++ b/pkgs/development/libraries/qt-6/hooks/fix-qt-module-paths.sh @@ -6,8 +6,6 @@ # fixQtModulePaths() { local dir="$1" - local bin="${!outputBin}" - local dev="${!outputDev}" local lib="${!outputLib}" if [ -d "$dir" ]; then @@ -17,8 +15,8 @@ fixQtModulePaths() { sed -i "${pr:?}" \ -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \ -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \ - -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$dev/include|g" \ - -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$dev/bin|g" + -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$lib/include|g" \ + -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$lib/bin|g" fi done elif [ -e "$dir" ]; then @@ -26,11 +24,4 @@ fixQtModulePaths() { else echo "fixQtModulePaths: Warning: \`$dir' does not exist" fi - - if [ "z$bin" != "z$dev" ]; then - if [ -d "$bin/bin" ]; then - mkdir -p "$dev/bin" - lndir -silent "$bin/bin" "$dev/bin" - fi - fi } diff --git a/pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh b/pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh deleted file mode 100644 index 85489c85105b..000000000000 --- a/pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh +++ /dev/null @@ -1,34 +0,0 @@ -updateToolPath() { - local tool="$1" - local target="$2" - local original="${!outputBin}/$tool" - local actual="${!outputDev}/$tool" - if grep -q "$original" "$target"; then - echo "updateToolPath: Updating \`$original' in \`$target\'..." - sed -i "$target" -e "s|$original|$actual|" - fi -} - -moveQtDevTools() { - if [ -n "$devTools" ]; then - for tool in $devTools; do - moveToOutput "$tool" "${!outputDev}" - done - - if [ -d "${!outputDev}/mkspecs" ]; then - find "${!outputDev}/mkspecs" -name '*.pr?' | while read pr_; do - for tool in $devTools; do - updateToolPath "$tool" "$pr_" - done - done - fi - - if [ -d "${!outputDev}/lib/cmake" ]; then - find "${!outputDev}/lib/cmake" -name '*.cmake' | while read cmake; do - for tool in $devTools; do - updateToolPath "$tool" "$cmake" - done - done - fi - fi -} diff --git a/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh index 16d9f31dbadf..38a0a1d0530c 100644 --- a/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh +++ b/pkgs/development/libraries/qt-6/hooks/qtbase-setup-hook.sh @@ -1,13 +1,13 @@ if [[ -n "${__nix_qtbase-}" ]]; then # Throw an error if a different version of Qt was already set up. - if [[ "$__nix_qtbase" != "@dev@" ]]; then + if [[ "$__nix_qtbase" != "@out@" ]]; then echo >&2 "Error: detected mismatched Qt dependencies:" - echo >&2 " @dev@" + echo >&2 " @out@" echo >&2 " $__nix_qtbase" exit 1 fi else # Only set up Qt once. - __nix_qtbase="@dev@" + __nix_qtbase="@out@" qtPluginPrefix=@qtPluginPrefix@ qtQmlPrefix=@qtQmlPrefix@ @@ -30,7 +30,7 @@ else # Only set up Qt once. fi # Build tools are often confused if QMAKE is unset. - export QMAKE=@dev@/bin/qmake + export QMAKE=@out@/bin/qmake export QMAKEPATH= @@ -53,25 +53,18 @@ else # Only set up Qt once. # Prevent this hook from running multiple times dontPatchMkspecs=1 - local bin="${!outputBin}" - local dev="${!outputDev}" - local doc="${!outputDoc}" local lib="${!outputLib}" - moveToOutput "mkspecs" "$dev" - moveToOutput "modules" "$dev" - moveToOutput "lib/*.prl" "$dev" - - if [ -d "$dev/mkspecs/modules" ]; then - fixQtModulePaths "$dev/mkspecs/modules" + if [ -d "$lib/mkspecs/modules" ]; then + fixQtModulePaths "$lib/mkspecs/modules" fi - if [ -d "$dev/mkspecs" ]; then - fixQtBuiltinPaths "$dev/mkspecs" '*.pr?' + if [ -d "$lib/mkspecs" ]; then + fixQtBuiltinPaths "$lib/mkspecs" '*.pr?' fi - if [ -d "$dev/lib" ]; then - fixQtBuiltinPaths "$dev/lib" '*.pr?' + if [ -d "$lib/lib" ]; then + fixQtBuiltinPaths "$lib/lib" '*.pr?' fi } if [ -z "${dontPatchMkspecs-}" ]; then diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index 3a4e6d8c8901..dfd51f26587b 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -71,10 +71,14 @@ , unixODBC , unixODBCDrivers # darwin +, moveBuildTree , xcbuild , AGL , AVFoundation , AppKit +, Contacts +, CoreBluetooth +, EventKit , GSS , MetalKit # optional dependencies @@ -166,6 +170,9 @@ stdenv.mkDerivation rec { AGL AVFoundation AppKit + Contacts + CoreBluetooth + EventKit GSS MetalKit ] ++ lib.optional libGLSupported libGL; @@ -184,7 +191,8 @@ stdenv.mkDerivation rec { ++ lib.optional (libmysqlclient != null) libmysqlclient ++ lib.optional (postgresql != null) postgresql; - nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ]; + nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ] + ++ lib.optionals stdenv.isDarwin [ moveBuildTree ]; propagatedNativeBuildInputs = [ lndir ]; @@ -204,14 +212,13 @@ stdenv.mkDerivation rec { preHook = '' . "$fix_qt_builtin_paths" . "$fix_qt_module_paths" - . ${../hooks/move-qt-dev-tools.sh} - . ${../hooks/fix-qmake-libtool.sh} ''; qtPluginPrefix = "lib/qt-6/plugins"; qtQmlPrefix = "lib/qt-6/qml"; cmakeFlags = [ + "-DQT_EMBED_TOOLCHAIN_COMPILER=OFF" "-DINSTALL_PLUGINSDIR=${qtPluginPrefix}" "-DINSTALL_QMLDIR=${qtQmlPrefix}" "-DQT_FEATURE_libproxy=ON" @@ -233,57 +240,11 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - devTools = [ - "libexec/moc" - "libexec/rcc" - "libexec/syncqt.pl" - "libexec/qlalr" - "libexec/ensure_pro_file.cmake" - "libexec/cmake_automoc_parser" - "libexec/qvkgen" - "libexec/tracegen" - "libexec/uic" - "bin/fixqt4headers.pl" - "bin/moc" - "bin/qdbuscpp2xml" - "bin/qdbusxml2cpp" - "bin/qlalr" - "bin/qmake" - "bin/qmake6" - "bin/qt-cmake" - "bin/qt-cmake-private" - "bin/qt-cmake-private-install.cmake" - "bin/qt-cmake-standalone-test" - "bin/rcc" - "bin/syncqt.pl" - "bin/uic" - ]; + moveToDev = false; postFixup = '' - moveToOutput "mkspecs" "$dev" - moveToOutput "modules" "$dev" - moveToOutput "lib/*.prl" "$dev" - - fixQtModulePaths "$dev/mkspecs/modules" - fixQtBuiltinPaths "$dev" '*.pr?' - - # Move development tools to $dev - moveQtDevTools - moveToOutput libexec "$dev" - - # fixup .pc file (where to find 'moc' etc.) - if [ -f "$dev/lib/pkgconfig/Qt6Core.pc" ]; then - sed -i "$dev/lib/pkgconfig/Qt6Core.pc" \ - -e "/^bindir=/ c bindir=$dev/bin" \ - -e "/^libexecdir=/ c libexecdir=$dev/libexec" - fi - - patchShebangs $out $dev - - # QTEST_ASSERT and other macros keeps runtime reference to qtbase.dev - if [ -f "$dev/include/QtTest/qtestassert.h" ]; then - substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__" - fi + fixQtModulePaths "$out/mkspecs/modules" + fixQtBuiltinPaths "$out" '*.pr?' ''; dontStrip = debugSymbols; diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix index 48855377f2ff..d78a886109af 100644 --- a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix @@ -10,31 +10,8 @@ qtModule { pname = "qtdeclarative"; qtInputs = [ qtbase qtlanguageserver qtshadertools ]; propagatedBuildInputs = [ openssl python3 ]; - preConfigure = '' - export LD_LIBRARY_PATH="$PWD/build/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" - ''; - cmakeFlags = [ - "-DQT6_INSTALL_PREFIX=${placeholder "out"}" - "-DQT_INSTALL_PREFIX=${placeholder "out"}" - ]; patches = [ # prevent headaches from stale qmlcache data ../patches/qtdeclarative-default-disable-qmlcache.patch ]; - postInstall = '' - substituteInPlace "$out/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake" \ - --replace ''\'''${QT6_INSTALL_PREFIX}' "$dev" - ''; - devTools = [ - "bin/qml" - "bin/qmlcachegen" - "bin/qmleasing" - "bin/qmlimportscanner" - "bin/qmllint" - "bin/qmlmin" - "bin/qmlplugindump" - "bin/qmlprofiler" - "bin/qmlscene" - "bin/qmltestrunner" - ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qttools.nix b/pkgs/development/libraries/qt-6/modules/qttools.nix index e913cee041f4..42bf495134a4 100644 --- a/pkgs/development/libraries/qt-6/modules/qttools.nix +++ b/pkgs/development/libraries/qt-6/modules/qttools.nix @@ -15,30 +15,10 @@ qtModule { ../patches/qttools-paths.patch ]; env.NIX_CFLAGS_COMPILE = toString [ - "-DNIX_OUTPUT_DEV=\"${placeholder "dev"}\"" + "-DNIX_OUTPUT_OUT=\"${placeholder "out"}\"" ]; - - devTools = [ - "bin/qcollectiongenerator" - "bin/linguist" - "bin/assistant" - "bin/qdoc" - "bin/lconvert" - "bin/designer" - "bin/qtattributionsscanner" - "bin/lrelease" - "bin/lrelease-pro" - "bin/pixeltool" - "bin/lupdate" - "bin/lupdate-pro" - "bin/qtdiag" - "bin/qhelpgenerator" - "bin/qtplugininfo" - "bin/qthelpconverter" - "bin/lprodump" - "bin/qdistancefieldgenerator" - ] ++ lib.optionals stdenv.isDarwin [ - "bin/macdeployqt" - ]; - + postInstall = '' + mkdir -p "$dev" + ln -s "$out/bin" "$dev/bin" + ''; } diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix index a8f69a5659eb..54823fdecd1c 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -110,6 +110,13 @@ qtModule { substituteInPlace cmake/Functions.cmake \ --replace "/bin/bash" "${buildPackages.bash}/bin/bash" + # Patch library paths in sources + substituteInPlace src/core/web_engine_library_info.cpp \ + --replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \ + --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \ + --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\"" + '' + + lib.optionalString stdenv.isLinux '' sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ src/3rdparty/chromium/device/udev_linux/udev?_loader.cc @@ -118,12 +125,6 @@ qtModule { substituteInPlace src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc \ --replace "/usr/share/X11/xkb" "${xkeyboard_config}/share/X11/xkb" - - # Patch library paths in sources - substituteInPlace src/core/web_engine_library_info.cpp \ - --replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \ - --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \ - --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\"" ''; cmakeFlags = [ @@ -143,9 +144,12 @@ qtModule { # android only. https://bugreports.qt.io/browse/QTBUG-100293 # "-DQT_FEATURE_webengine_native_spellchecker=ON" "-DQT_FEATURE_webengine_sanitizer=ON" - "-DQT_FEATURE_webengine_webrtc_pipewire=ON" "-DQT_FEATURE_webengine_kerberos=ON" - ] ++ lib.optional enableProprietaryCodecs "-DQT_FEATURE_webengine_proprietary_codecs=ON"; + ] ++ lib.optionals stdenv.isLinux [ + "-DQT_FEATURE_webengine_webrtc_pipewire=ON" + ] ++ lib.optionals enableProprietaryCodecs [ + "-DQT_FEATURE_webengine_proprietary_codecs=ON" + ]; propagatedBuildInputs = [ # Image formats @@ -174,7 +178,7 @@ qtModule { libevent ffmpeg_4 - + ] ++ lib.optionals stdenv.isLinux [ dbus zlib minizip @@ -226,12 +230,6 @@ qtModule { export NINJAFLAGS="-j$NIX_BUILD_CORES" ''; - postFixup = '' - # This is required at runtime - mkdir -p $out/libexec - mv $dev/libexec/QtWebEngineProcess $out/libexec - ''; - meta = with lib; { description = "A web engine based on the Chromium web browser"; platforms = platforms.linux; diff --git a/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch b/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch new file mode 100644 index 000000000000..5a13930024fb --- /dev/null +++ b/pkgs/development/libraries/qt-6/patches/0001-qtbase-qmake-always-use-libname-instead-of-absolute-.patch @@ -0,0 +1,50 @@ +From 8880bc263a366aeb82056f0bf3f1b17b6ec26900 Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Thu, 13 Apr 2023 23:42:29 +0800 +Subject: [PATCH 1/6] qtbase: qmake: always use libname instead of absolute + path in qmake files + +In generated qmake files, absolute paths to qt libraries are embedded +and then used in linker flags. However as the libraries can be provided +by qt modules other than the one currently being built, the ebedded +paths can be incorrect. +--- + cmake/QtFinishPrlFile.cmake | 7 ++++--- + cmake/QtGenerateLibHelpers.cmake | 3 --- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/cmake/QtFinishPrlFile.cmake b/cmake/QtFinishPrlFile.cmake +index 32169e418c..4e754af367 100644 +--- a/cmake/QtFinishPrlFile.cmake ++++ b/cmake/QtFinishPrlFile.cmake +@@ -61,9 +61,10 @@ foreach(line ${lines}) + endif() + list(APPEND adjusted_libs "-framework" "${CMAKE_MATCH_1}") + else() +- # Not a framework, transform the Qt module into relocatable relative path. +- qt_strip_library_version_suffix(relative_lib "${relative_lib}") +- list(APPEND adjusted_libs "$$[QT_INSTALL_LIBS]/${relative_lib}") ++ # Not a framework, extract the library name and prepend an -l to make ++ # it relocatable. ++ qt_transform_absolute_library_paths_to_link_flags(lib_with_link_flag "${lib}") ++ list(APPEND adjusted_libs "${lib_with_link_flag}") + endif() + endif() + else() +diff --git a/cmake/QtGenerateLibHelpers.cmake b/cmake/QtGenerateLibHelpers.cmake +index e3f4bbf881..f8bd26acc7 100644 +--- a/cmake/QtGenerateLibHelpers.cmake ++++ b/cmake/QtGenerateLibHelpers.cmake +@@ -70,9 +70,6 @@ function(qt_transform_absolute_library_paths_to_link_flags out_var library_path_ + string(TOLOWER "${dir}" dir_lower) + # If library_path isn't in default link directories, we should add it to link flags. + list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index) +- if(${index} EQUAL -1) +- list(APPEND out_list "-L\"${dir}\"") +- endif() + list(APPEND out_list "${lib_name_with_link_flag}") + else() + list(APPEND out_list "${library_path}") +-- +2.39.2 + diff --git a/pkgs/development/libraries/qt-6/patches/qtbase-qmake-mkspecs-mac.patch b/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch similarity index 96% rename from pkgs/development/libraries/qt-6/patches/qtbase-qmake-mkspecs-mac.patch rename to pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch index 0830a4432bf2..c628f9f25071 100644 --- a/pkgs/development/libraries/qt-6/patches/qtbase-qmake-mkspecs-mac.patch +++ b/pkgs/development/libraries/qt-6/patches/0002-qtbase-qmake-fix-mkspecs-for-darwin.patch @@ -1,5 +1,19 @@ +From 034db4e75ec749ac78fcf8235fa659b0eca83c30 Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Fri, 14 Apr 2023 09:34:08 +0800 +Subject: [PATCH 2/6] qtbase: qmake: fix mkspecs for darwin + +--- + mkspecs/common/mac.conf | 2 +- + mkspecs/features/mac/default_post.prf | 263 -------------------------- + mkspecs/features/mac/default_pre.prf | 58 ------ + mkspecs/features/mac/sdk.mk | 27 --- + mkspecs/features/mac/sdk.prf | 61 ------ + mkspecs/features/mac/toolchain.prf | 5 - + 6 files changed, 1 insertion(+), 415 deletions(-) + diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf -index 61bea952..9909dae7 100644 +index 61bea952b2..9909dae726 100644 --- a/mkspecs/common/mac.conf +++ b/mkspecs/common/mac.conf @@ -23,7 +23,7 @@ QMAKE_INCDIR_OPENGL = \ @@ -12,7 +26,7 @@ index 61bea952..9909dae7 100644 QMAKE_LFLAGS_REL_RPATH = diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf -index 09db1764..aadfce87 100644 +index 09db1764b1..aadfce875e 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,9 +1,5 @@ @@ -299,7 +313,7 @@ index 09db1764..aadfce87 100644 generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS generate_xcode_project.target = xcodeproj diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf -index e3534561..3b01424e 100644 +index e3534561a5..3b01424e67 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -1,60 +1,2 @@ @@ -364,7 +378,7 @@ index e3534561..3b01424e 100644 -xcode_copy_phase_strip_setting.value = NO -QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk -index a32ceacb..e69de29b 100644 +index a32ceacb6c..e69de29bb2 100644 --- a/mkspecs/features/mac/sdk.mk +++ b/mkspecs/features/mac/sdk.mk @@ -1,27 +0,0 @@ @@ -396,7 +410,7 @@ index a32ceacb..e69de29b 100644 - endif -endif diff --git a/mkspecs/features/mac/sdk.prf b/mkspecs/features/mac/sdk.prf -index 3a9c2778..e69de29b 100644 +index 3a9c2778bb..e69de29bb2 100644 --- a/mkspecs/features/mac/sdk.prf +++ b/mkspecs/features/mac/sdk.prf @@ -1,61 +0,0 @@ @@ -462,7 +476,7 @@ index 3a9c2778..e69de29b 100644 - cache($$tool_variable, set stash, $$tool) -} diff --git a/mkspecs/features/mac/toolchain.prf b/mkspecs/features/mac/toolchain.prf -index df191eb1..e69de29b 100644 +index df191eb13c..e69de29bb2 100644 --- a/mkspecs/features/mac/toolchain.prf +++ b/mkspecs/features/mac/toolchain.prf @@ -1,5 +0,0 @@ @@ -471,3 +485,6 @@ index df191eb1..e69de29b 100644 -sdk: load(sdk) - -load(toolchain) +-- +2.39.2 + diff --git a/pkgs/development/libraries/qt-6/patches/qtbase-qmake-pkg-config.patch b/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch similarity index 58% rename from pkgs/development/libraries/qt-6/patches/qtbase-qmake-pkg-config.patch rename to pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch index 90caaea1cf4d..df1effff83ef 100644 --- a/pkgs/development/libraries/qt-6/patches/qtbase-qmake-pkg-config.patch +++ b/pkgs/development/libraries/qt-6/patches/0003-qtbase-qmake-fix-includedir-in-generated-pkg-config.patch @@ -1,7 +1,17 @@ +From bc91f05db85b774f26d6bce86e2e618dfc7a6883 Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Fri, 14 Apr 2023 09:34:46 +0800 +Subject: [PATCH 3/6] qtbase: qmake: fix includedir in generated pkg-config + +--- + qmake/generators/makefile.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp +index da585bd9b2..3abf9cee83 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp -@@ -3390,8 +3390,7 @@ MakefileGenerator::writePkgConfigFile() +@@ -3402,8 +3402,7 @@ MakefileGenerator::writePkgConfigFile() << varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ") // << varGlue("DEFINES","-D"," -D"," ") ; @@ -11,4 +21,6 @@ diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle") && libDir != QLatin1String("/Library/Frameworks")) { t << " -F${libdir}"; +-- +2.39.2 diff --git a/pkgs/development/libraries/qt-6/patches/qtbase-tzdir.patch b/pkgs/development/libraries/qt-6/patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch similarity index 84% rename from pkgs/development/libraries/qt-6/patches/qtbase-tzdir.patch rename to pkgs/development/libraries/qt-6/patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch index fc36130c7aad..1e66804a5c10 100644 --- a/pkgs/development/libraries/qt-6/patches/qtbase-tzdir.patch +++ b/pkgs/development/libraries/qt-6/patches/0004-qtbase-fix-locating-tzdir-on-NixOS.patch @@ -1,5 +1,14 @@ +From d612c1d7161f95864b9383df84b16d8c24fbcc9b Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Fri, 14 Apr 2023 09:35:25 +0800 +Subject: [PATCH 4/6] qtbase: fix locating tzdir on NixOS + +--- + src/corelib/time/qtimezoneprivate_tz.cpp | 27 +++++++++++++++--------- + 1 file changed, 17 insertions(+), 10 deletions(-) + diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp -index 627a4a81..a5f50acc 100644 +index e87e34f76d..39bd79d4a4 100644 --- a/src/corelib/time/qtimezoneprivate_tz.cpp +++ b/src/corelib/time/qtimezoneprivate_tz.cpp @@ -51,7 +51,11 @@ typedef QHash QTzTimeZoneHash; @@ -15,7 +24,7 @@ index 627a4a81..a5f50acc 100644 if (!QFile::exists(path)) path = QStringLiteral("/usr/lib/zoneinfo/zone.tab"); -@@ -727,18 +731,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId) +@@ -729,18 +733,21 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId) if (!tzif.open(QIODevice::ReadOnly)) return ret; } else { @@ -46,3 +55,6 @@ index 627a4a81..a5f50acc 100644 } } } +-- +2.39.2 + diff --git a/pkgs/development/libraries/qt-6/patches/qtbase-variable-fonts.patch b/pkgs/development/libraries/qt-6/patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch similarity index 83% rename from pkgs/development/libraries/qt-6/patches/qtbase-variable-fonts.patch rename to pkgs/development/libraries/qt-6/patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch index 96952d1ad160..121fc09b6451 100644 --- a/pkgs/development/libraries/qt-6/patches/qtbase-variable-fonts.patch +++ b/pkgs/development/libraries/qt-6/patches/0005-qtbase-deal-with-a-font-face-at-index-0-as-Regular-f.patch @@ -1,8 +1,8 @@ -From 9ba9c690fb16188ff524b53def104e68e45cf5c3 Mon Sep 17 00:00:00 2001 +From 5bd3672c7870b2e46e2a734dc9a9cb1837375a1c Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 21 Mar 2023 15:48:49 +0800 -Subject: [PATCH] Deal with a font face at index 0 as Regular for Variable - fonts +Subject: [PATCH 5/6] qtbase: deal with a font face at index 0 as Regular for + Variable fonts Reference: https://bugreports.qt.io/browse/QTBUG-111994 --- diff --git a/pkgs/development/libraries/qt-6/patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch b/pkgs/development/libraries/qt-6/patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch new file mode 100644 index 000000000000..addd7a868317 --- /dev/null +++ b/pkgs/development/libraries/qt-6/patches/0006-qtbase-qt-cmake-always-use-cmake-from-path.patch @@ -0,0 +1,32 @@ +From f0017e872297168ab616096180891c7f312ef1a1 Mon Sep 17 00:00:00 2001 +From: Nick Cao +Date: Wed, 12 Apr 2023 10:13:50 +0800 +Subject: [PATCH 6/6] qtbase: qt-cmake: always use cmake from path + +The generated qt-cmake scripts embeds the absolute path of cmake used +during the build of qtbase, bloating the runtime closure of qtbase. +--- + bin/qt-cmake.in | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in +index f719257f60..571ffe788f 100755 +--- a/bin/qt-cmake.in ++++ b/bin/qt-cmake.in +@@ -4,12 +4,7 @@ + script_dir_path=`dirname $0` + script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` + +-# Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH. +-original_cmake_path="@CMAKE_COMMAND@" +-cmake_path=$original_cmake_path +-if ! test -f "$cmake_path"; then +- cmake_path="cmake" +-fi ++cmake_path="cmake" + + toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@/qt.toolchain.cmake" + +-- +2.39.2 + diff --git a/pkgs/development/libraries/qt-6/patches/cmake.patch b/pkgs/development/libraries/qt-6/patches/cmake.patch deleted file mode 100644 index 84192f669696..000000000000 --- a/pkgs/development/libraries/qt-6/patches/cmake.patch +++ /dev/null @@ -1,123 +0,0 @@ -commit bd8f6ecea0663bdd150aa48941cbd47d25874396 -Author: Nick Cao -Date: Tue Apr 19 13:49:59 2022 +0800 - - patch cmake file generation for nixpkgs packaging - - As of qt 6.3.0, installing components into different prefixes is not - supported. To workaround that, we move files to their designated in the - postInstall hook. However the generated cmake files still have - references to the original prefix, and would cause issues when using - said components as the dependency of other packages. The purpose of this - patch is to closely match the output layout of qt, and rewrite the - generated cmake files to point to the corrected pathes. - -diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx -index 5a33349b19..677a6084d6 100644 ---- a/Source/cmExportFileGenerator.cxx -+++ b/Source/cmExportFileGenerator.cxx -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - - #include - -@@ -330,9 +331,21 @@ static void prefixItems(std::string& exportDirs) - for (std::string const& e : entries) { - exportDirs += sep; - sep = ";"; -- if (!cmSystemTools::FileIsFullPath(e) && -- e.find("${_IMPORT_PREFIX}") == std::string::npos) { -- exportDirs += "${_IMPORT_PREFIX}/"; -+ if (!cmSystemTools::FileIsFullPath(e)) { -+ if (std::getenv("dev")) { -+ if (cmHasLiteralPrefix(e, "include") || cmHasLiteralPrefix(e, "./include")) { -+ exportDirs += std::getenv("dev"); -+ } else if (cmHasLiteralPrefix(e, "mkspecs") || cmHasLiteralPrefix(e, "./mkspecs")) { -+ exportDirs += std::getenv("dev"); -+ } else if (cmHasLiteralPrefix(e, "libexec") || cmHasLiteralPrefix(e, "./libexec")) { -+ exportDirs += std::getenv("dev"); -+ } else { -+ exportDirs += std::getenv("out"); -+ } -+ } else { -+ exportDirs += std::getenv("out"); -+ } -+ exportDirs += "/"; - } - exportDirs += e; - } -diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx -index adccdfeece..ba248305bd 100644 ---- a/Source/cmExportInstallFileGenerator.cxx -+++ b/Source/cmExportInstallFileGenerator.cxx -@@ -6,6 +6,7 @@ - #include - #include - #include -+#include - - #include "cmExportSet.h" - #include "cmFileSet.h" -@@ -266,7 +267,7 @@ void cmExportInstallFileGenerator::LoadConfigFiles(std::ostream& os) - - void cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string& input) - { -- cmGeneratorExpression::ReplaceInstallPrefix(input, "${_IMPORT_PREFIX}"); -+ cmGeneratorExpression::ReplaceInstallPrefix(input, std::getenv("out")); - } - - bool cmExportInstallFileGenerator::GenerateImportFileConfig( -@@ -382,9 +383,22 @@ void cmExportInstallFileGenerator::SetImportLocationProperty( - // Construct the installed location of the target. - std::string dest = itgen->GetDestination(config); - std::string value; -+ - if (!cmSystemTools::FileIsFullPath(dest)) { -- // The target is installed relative to the installation prefix. -- value = "${_IMPORT_PREFIX}/"; -+ if (std::getenv("dev")) { -+ if (cmHasLiteralPrefix(dest, "include") || cmHasLiteralPrefix(dest, "./include")) { -+ value = std::getenv("dev"); -+ } else if (cmHasLiteralPrefix(dest, "mkspecs") || cmHasLiteralPrefix(dest, "./mkspecs")) { -+ value = std::getenv("dev"); -+ } else if (cmHasLiteralPrefix(dest, "libexec") || cmHasLiteralPrefix(dest, "./libexec")) { -+ value = std::getenv("dev"); -+ } else { -+ value = std::getenv("out"); -+ } -+ } else { -+ value = std::getenv("out"); -+ } -+ value += "/"; - } - value += dest; - value += "/"; -diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx -index f988e54a19..cc5c7ac9fd 100644 ---- a/Source/cmGeneratorExpression.cxx -+++ b/Source/cmGeneratorExpression.cxx -@@ -192,7 +192,20 @@ static void prefixItems(const std::string& content, std::string& result, - sep = ";"; - if (!cmSystemTools::FileIsFullPath(e) && - cmGeneratorExpression::Find(e) != 0) { -- result += prefix; -+ if (std::getenv("dev")) { -+ if (cmHasLiteralPrefix(e, "include") || cmHasLiteralPrefix(e, "./include")) { -+ result += std::getenv("dev"); -+ } else if (cmHasLiteralPrefix(e, "mkspecs") || cmHasLiteralPrefix(e, "./mkspecs")) { -+ result += std::getenv("dev"); -+ } else if (cmHasLiteralPrefix(e, "libexec") || cmHasLiteralPrefix(e, "./libexec")) { -+ result += std::getenv("dev"); -+ } else { -+ result += std::getenv("out"); -+ } -+ } else { -+ result += std::getenv("out"); -+ } -+ result += "/"; - } - result += e; - } diff --git a/pkgs/development/libraries/qt-6/patches/qttools-paths.patch b/pkgs/development/libraries/qt-6/patches/qttools-paths.patch index 9a0acb70b0f4..6e7b8488fa54 100644 --- a/pkgs/development/libraries/qt-6/patches/qttools-paths.patch +++ b/pkgs/development/libraries/qt-6/patches/qttools-paths.patch @@ -10,9 +10,9 @@ index d355b9dc..94fef33f 100644 +{ + switch (location) { + case QLibraryInfo::BinariesPath: -+ return QLatin1String(NIX_OUTPUT_DEV) + QLatin1String("/bin"); ++ return QLatin1String(NIX_OUTPUT_OUT) + QLatin1String("/bin"); + case QLibraryInfo::LibraryExecutablesPath: -+ return QLatin1String(NIX_OUTPUT_DEV) + QLatin1String("/libexec"); ++ return QLatin1String(NIX_OUTPUT_OUT) + QLatin1String("/libexec"); + default: + return QLibraryInfo::path(location); + } diff --git a/pkgs/development/libraries/qt-6/qt-env.nix b/pkgs/development/libraries/qt-6/qt-env.nix index 0b41f0c07351..0202783a9d8e 100644 --- a/pkgs/development/libraries/qt-6/qt-env.nix +++ b/pkgs/development/libraries/qt-6/qt-env.nix @@ -9,7 +9,7 @@ buildEnv { postBuild = '' rm "$out/bin/qmake" - cp "${qtbase.dev}/bin/qmake" "$out/bin" + cp "${qtbase}/bin/qmake" "$out/bin" cat >"$out/bin/qt.conf" <