Merge staging-next into staging

This commit is contained in:
Frederik Rietdijk 2020-09-04 20:03:30 +02:00
commit af81d39b87
182 changed files with 4683 additions and 7025 deletions

View File

@ -263,6 +263,8 @@ Sometimes plugins require an override that must be changed when the plugin is up
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 Language Server Protocol integration with vim/neovim.
## Important repositories ## Important repositories
- [vim-pi](https://bitbucket.org/vimcommunity/vim-pi) is a plugin repository - [vim-pi](https://bitbucket.org/vimcommunity/vim-pi) is a plugin repository

View File

@ -689,14 +689,15 @@ rec {
"/prefix/nix-profiles-library-paths.patch" "/prefix/nix-profiles-library-paths.patch"
"/prefix/compose-search-path.patch" ] "/prefix/compose-search-path.patch" ]
*/ */
readPathsFromFile = rootPath: file: readPathsFromFile = lib.warn "lib.readPathsFromFile is deprecated, use a list instead"
let (rootPath: file:
lines = lib.splitString "\n" (builtins.readFile file); let
removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line)); lines = lib.splitString "\n" (builtins.readFile file);
relativePaths = removeComments lines; removeComments = lib.filter (line: line != "" && !(lib.hasPrefix "#" line));
absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths; relativePaths = removeComments lines;
in absolutePaths = builtins.map (path: rootPath + "/${path}") relativePaths;
absolutePaths; in
absolutePaths);
/* Read the contents of a file removing the trailing \n /* Read the contents of a file removing the trailing \n

View File

@ -4098,6 +4098,12 @@
githubId = 1918771; githubId = 1918771;
name = "Joe Doyle"; name = "Joe Doyle";
}; };
jperras = {
email = "joel@nerderati.com";
github = "jperras";
githubId = 20675;
name = "Joël Perras";
};
jpierre03 = { jpierre03 = {
email = "nix@prunetwork.fr"; email = "nix@prunetwork.fr";
github = "jpierre03"; github = "jpierre03";

View File

@ -8,24 +8,26 @@
<title>Release process</title> <title>Release process</title>
<para> <para>
Going through an example of releasing NixOS 17.09: Going through an example of releasing NixOS 19.09:
</para> </para>
<section xml:id="one-month-before-the-beta"> <section xml:id="one-month-before-the-beta">
<title>One month before the beta</title> <title>One month before the beta</title>
<itemizedlist spacing="compact"> <itemizedlist>
<listitem> <listitem>
<para> <para>
Send an email to the nix-devel mailinglist as a warning about upcoming Create an announcement on <link xlink:href="https://discourse.nixos.org">Discourse</link> as a warning about upcoming beta <quote>feature freeze</quote> in a month. <link xlink:href="https://discourse.nixos.org/t/nixos-19-09-feature-freeze/3707">See this post as an example</link>.
beta "feature freeze" in a month.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Discuss with Eelco Dolstra and the community (via IRC, ML) about what Discuss with Eelco Dolstra and the community (via IRC, ML) about what will reach the deadline. Any issue or Pull Request targeting the release should be included in the release milestone.
will reach the deadline. Any issue or Pull Request targeting the release </para>
should be included in the release milestone. </listitem>
<listitem>
<para>
Remove attributes that we know we will not be able to support, especially if there is a stable alternative. E.g. Check that our Linux kernels <link xlink:href="https://www.kernel.org/category/releases.html">projected end-of-life</link> are after our release projected end-of-life.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -34,113 +36,113 @@
<section xml:id="at-beta-release-time"> <section xml:id="at-beta-release-time">
<title>At beta release time</title> <title>At beta release time</title>
<itemizedlist spacing="compact"> <orderedlist>
<listitem> <listitem>
<para> <para>
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/13559">Create From the master branch run:
an issue for tracking Zero Hydra Failures progress. ZHF is an effort to </para>
get build failures down to zero.</link> <programlisting>
git checkout -b release-19.09
</programlisting>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/10e61bf5be57736035ec7a804cb0bf3d083bf2cf#diff-9c798092bac0caeb5c52d509be0ca263R69">Bump the <literal>system.defaultChannel</literal> attribute in <literal>nixos/modules/misc/version.nix</literal></link>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<literal>git tag -a -s -m &quot;Release 17.09-beta&quot; 17.09-beta <link xlink:href="https://github.com/NixOS/nixpkgs/commit/10e61bf5be57736035ec7a804cb0bf3d083bf2cf#diff-831e8d9748240fb23e6734fdc2a6d16eR15">Update <literal>versionSuffix</literal> in <literal>nixos/release.nix</literal></link>
&amp;&amp; git push origin 17.09-beta</literal>
</para> </para>
</listitem> </listitem>
</orderedlist>
<para>
To get the commit count, use the following command:
</para>
<programlisting>
git rev-list --count release-19.09
</programlisting>
<orderedlist>
<listitem> <listitem>
<para> <para>
From the master branch run <literal>git checkout -b Edit changelog at <literal>nixos/doc/manual/release-notes/rl-1909.xml</literal>.
release-17.09</literal>.
</para> </para>
</listitem> <itemizedlist>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-org-configurations/pull/18">
Make sure a channel is created at https://nixos.org/channels/. </link>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/compare/bdf161ed8d21...6b63c4616790">
Bump the <literal>system.defaultChannel</literal> attribute in
<literal>nixos/modules/misc/version.nix</literal> </link>
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/d6b08acd1ccac0d9d502c4b635e00b04d3387f06">
Update <literal>versionSuffix</literal> in
<literal>nixos/release.nix</literal></link>, use
<literal>git rev-list --count 17.09-beta</literal>
to get the commit count.
</para>
</listitem>
<listitem>
<para>
<literal>echo -n &quot;18.03&quot; &gt; .version</literal> on master.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/b8a4095003e27659092892a4708bb3698231a842">
Pick a new name for the unstable branch. </link>
</para>
</listitem>
<listitem>
<para>
Create a new release notes file for the upcoming release + 1, in this
case <literal>rl-1803.xml</literal>.
</para>
</listitem>
<listitem>
<para>
Create two Hydra jobsets: release-17.09 and release-17.09-small with
<literal>stableBranch</literal> set to false.
</para>
</listitem>
<listitem>
<para>
Remove attributes that we know we will not be able to support,
especially if there is a stable alternative. E.g. Check that our
Linux kernels'
<link xlink:href="https://www.kernel.org/category/releases.html">
projected end-of-life</link> are after our release projected
end-of-life
</para>
</listitem>
<listitem>
<para>
Edit changelog at
<literal>nixos/doc/manual/release-notes/rl-1709.xml</literal> (double
check desktop versions are noted)
</para>
<itemizedlist spacing="compact">
<listitem> <listitem>
<para> <para>
Get all new NixOS modules <literal>git diff Get all new NixOS modules:
release-17.03..release-17.09 nixos/modules/module-list.nix|grep
^+</literal>
</para> </para>
<programlisting>
git diff release-19.03..release-19.09 nixos/modules/module-list.nix | grep ^+
</programlisting>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Note systemd, kernel, glibc and Nix upgrades. Note systemd, kernel, glibc, desktop environment, and Nix upgrades.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
</listitem> </listitem>
</itemizedlist> <listitem>
<para>
Tag the release:
</para>
<programlisting>
git tag --annotate --message="Release 19.09-beta" 19.09-beta
git push upstream 19.09-beta
</programlisting>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/01268fda85b7eee4e462c873d8654f975067731f#diff-2bc0e46110b507d6d5a344264ef15adaR1">On the <literal>master</literal> branch, increment the <literal>.version</literal> file</link>
</para>
<programlisting>
echo -n "20.03" > .version
</programlisting>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/01268fda85b7eee4e462c873d8654f975067731f#diff-03f3d41b68f62079c55001f1a1c55c1dR137">Update <literal>codeName</literal> in <literal>lib/trivial.nix</literal></link> This will be the name for the next release.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/01268fda85b7eee4e462c873d8654f975067731f#diff-e7ee5ff686cdcc513ca089d6e5682587R11">Create a new release notes file for the upcoming release + 1</link>, in our case this is <literal>rl-2003.xml</literal>.
</para>
</listitem>
<listitem>
<para>
Contact the infrastructure team to create the necessary Hydra Jobsets.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-org-configurations/blob/master/channels.nix">Create a channel at https://nixos.org/channels by creating a PR to nixos-org-configurations, changing <literal>channels.nix</literal></link>
</para>
</listitem>
<listitem>
<para>
Get all Hydra jobsets for the release to have their first evaluation.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/13559">Create an issue for tracking Zero Hydra Failures progress. ZHF is an effort to get build failures down to zero.</link>
</para>
</listitem>
</orderedlist>
</section> </section>
<section xml:id="during-beta"> <section xml:id="during-beta">
<title>During Beta</title> <title>During Beta</title>
<itemizedlist spacing="compact"> <itemizedlist>
<listitem> <listitem>
<para> <para>
Monitor the master branch for bugfixes and minor updates and cherry-pick Monitor the master branch for bugfixes and minor updates and cherry-pick them to the release branch.
them to the release branch.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -149,7 +151,7 @@
<section xml:id="before-the-final-release"> <section xml:id="before-the-final-release">
<title>Before the final release</title> <title>Before the final release</title>
<itemizedlist spacing="compact"> <itemizedlist>
<listitem> <listitem>
<para> <para>
Re-check that the release notes are complete. Re-check that the release notes are complete.
@ -157,21 +159,17 @@
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Release Nix (currently only Eelco Dolstra can do that). Release Nix (currently only Eelco Dolstra can do that). <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nix-fallback-paths.nix">Make sure fallback is updated.</link>
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/installer/tools/nix-fallback-paths.nix">
Make sure fallback is updated. </link>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<link xlink:href="https://github.com/NixOS/nixpkgs/commit/40fd9ae3ac8048758abdcfc7d28a78b5f22fe97e"> <link xlink:href="https://github.com/NixOS/nixpkgs/commit/40fd9ae3ac8048758abdcfc7d28a78b5f22fe97e">Update README.md with new stable NixOS version information.</link>
Update README.md with new stable NixOS version information. </link>
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Change <literal>stableBranch</literal> to <literal>true</literal> in Hydra and wait for Change <literal>stableBranch</literal> to <literal>true</literal> in Hydra and wait for the channel to update.
the channel to update.
</para> </para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
@ -180,76 +178,143 @@
<section xml:id="at-final-release-time"> <section xml:id="at-final-release-time">
<title>At final release time</title> <title>At final release time</title>
<itemizedlist spacing="compact"> <orderedlist>
<listitem> <listitem>
<para> <para>
<literal>git tag -s -a -m &quot;Release 15.09&quot; 15.09</literal> Update <xref linkend="sec-upgrading" /> section of the manual to match new stable release version.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Update "Chapter 4. Upgrading NixOS" section of the manual to match Update <literal>rl-1909.xml</literal> with the release date.
new stable release version.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Update the Tag the final release
<link xlink:href="https://github.com/NixOS/nixos-homepage/commit/2a37975d5a617ecdfca94696242b6f32ffcba9f1"><code>NIXOS_SERIES</code></link>
in the
<link xlink:href="https://github.com/NixOS/nixos-homepage">nixos-homepage</link>
repository.
</para> </para>
<programlisting>
git tag --annotate --message="Release 19.09" 19.09
git push upstream 19.09
</programlisting>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Get number of commits for the release: <literal>git log Update <link xlink:href="https://github.com/NixOS/nixos-homepage">nixos-homepage</link> for the release.
release-14.04..release-14.12 --format=%an|wc -l</literal>
</para> </para>
<orderedlist>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-homepage/blob/47ac3571c4d71e841fd4e6c6e1872e762b9c4942/Makefile#L1">Update <literal>NIXOS_SERIES</literal> in the <literal>Makefile</literal></link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-homepage/blob/47ac3571c4d71e841fd4e6c6e1872e762b9c4942/nixos-release.tt#L1">Update <literal>nixos-release.tt</literal> with the new NixOS version</link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-homepage/blob/47ac3571c4d71e841fd4e6c6e1872e762b9c4942/flake.nix#L10">Update the <literal>flake.nix</literal> input <literal>released-nixpkgs</literal> to 19.09</link>.
</para>
</listitem>
<listitem>
<para>
Run <literal>./update.sh</literal> (this updates flake.lock to updated channel).
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-homepage/blob/a5626c71c03a2dd69086564e56f1a230a2bb177a/logo/nixos-logo-19.09-loris-lores.png">Add a compressed version of the NixOS logo for 19.09</link>.
</para>
</listitem>
<listitem>
<para>
<link xlink:href="https://github.com/NixOS/nixos-homepage/commit/a5626c71c03a2dd69086564e56f1a230a2bb177a#diff-9cdc6434d3e4fd93a6e5bb0a531a7c71R5">Compose a news item for the website RSS feed</link>.
</para>
</listitem>
</orderedlist>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Commits by contributor: <literal>git log release-14.04..release-14.12 Create a new topic on <link xlink:href="https://discourse.nixos.org/">the Discourse instance</link> to announce the release.
--format=%an|sort|uniq -c|sort -rn</literal>
</para> </para>
</listitem> </listitem>
</orderedlist>
<para>
You should include the following information:
</para>
<itemizedlist>
<listitem>
<para>
Number of commits for the release:
</para>
<programlisting>
bash git log release-19.03..release-19.09 --format=%an | wc -l
</programlisting>
</listitem>
<listitem> <listitem>
<para> <para>
Create a new topic on <link xlink:href="https://discourse.nixos.org/">the Commits by contributor:
Discourse instance</link> to announce the release with the above information.
Best to check how previous email was formulated to see what needs to be
included.
</para> </para>
<programlisting>
git shortlog --summary --numbered release-19.03..release-19.09
</programlisting>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>
Best to check how the previous post was formulated to see what needs to be included.
</para>
</section> </section>
</section> </section>
<section xml:id="release-managers"> <section xml:id="release-management-team">
<title>Release Management Team</title> <title>Release Management Team</title>
<para> <para>
For each release there are two release managers. After each release the For each release there are two release managers. After each release the release manager having managed two releases steps down and the release management team of the last release appoints a new release manager.
release manager having managed two releases steps down and the release
management team of the last release appoints a new release manager.
</para> </para>
<para> <para>
This makes sure a release management team always consists of one release This makes sure a release management team always consists of one release manager who already has managed one release and one release manager being introduced to their role, making it easier to pass on knowledge and experience.
manager who already has managed one release and one release manager being
introduced to their role, making it easier to pass on knowledge and
experience.
</para> </para>
<para> <para>
Release managers for the current NixOS release are tracked by GitHub team Release managers for the current NixOS release are tracked by GitHub team <link xlink:href="https://github.com/orgs/NixOS/teams/nixos-release-managers/members"><literal>@NixOS/nixos-release-managers</literal></link>.
<link xlink:href="https://github.com/orgs/NixOS/teams/nixos-release-managers/members"><literal>@NixOS/nixos-release-managers</literal></link>.
</para> </para>
<para> <para>
A release manager's role and responsibilities are: A release managers role and responsibilities are:
</para> </para>
<itemizedlist> <itemizedlist>
<listitem><para>manage the release process</para></listitem> <listitem>
<listitem><para>start discussions about features and changes for a given release</para></listitem> <para>
<listitem><para>create a roadmap</para></listitem> manage the release process
<listitem><para>release in cooperation with Eelco Dolstra</para></listitem> </para>
<listitem><para>decide which bug fixes, features, etc... get backported after a release</para></listitem> </listitem>
<listitem>
<para>
start discussions about features and changes for a given release
</para>
</listitem>
<listitem>
<para>
create a roadmap
</para>
</listitem>
<listitem>
<para>
release in cooperation with Eelco Dolstra
</para>
</listitem>
<listitem>
<para>
decide which bug fixes, features, etc… get backported after a release
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>
<section xml:id="release-schedule"> <section xml:id="release-schedule">

View File

@ -777,6 +777,11 @@ CREATE ROLE postgres LOGIN SUPERUSER;
<link xlink:href="https://github.com/NixOS/nixpkgs/pull/63103">PR #63103</link>. <link xlink:href="https://github.com/NixOS/nixpkgs/pull/63103">PR #63103</link>.
</para> </para>
</listitem> </listitem>
<listitem>
<para>
<literal>config.systemd.services.${name}.path</literal> now returns a list of paths instead of a colon-separated string.
</para>
</listitem>
</itemizedlist> </itemizedlist>
</section> </section>

View File

@ -234,7 +234,6 @@ in rec {
path = mkOption { path = mkOption {
default = []; default = [];
type = with types; listOf (oneOf [ package str ]); type = with types; listOf (oneOf [ package str ]);
apply = ps: "${makeBinPath ps}:${makeSearchPathOutput "bin" "sbin" ps}";
description = '' description = ''
Packages added to the service's <envar>PATH</envar> Packages added to the service's <envar>PATH</envar>
environment variable. Both the <filename>bin</filename> environment variable. Both the <filename>bin</filename>

View File

@ -257,7 +257,7 @@ let
pkgs.gnused pkgs.gnused
systemd systemd
]; ];
environment.PATH = config.path; environment.PATH = "${makeBinPath config.path}:${makeSearchPathOutput "bin" "sbin" config.path}";
} }
(mkIf (config.preStart != "") (mkIf (config.preStart != "")
{ serviceConfig.ExecStartPre = { serviceConfig.ExecStartPre =

View File

@ -1,8 +1,6 @@
{ mkDerivation { mkDerivation
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, fetchpatch
, installShellFiles
, qmake , qmake
, qtbase , qtbase
, qtmultimedia , qtmultimedia
@ -21,26 +19,18 @@ let
in in
mkDerivation rec { mkDerivation rec {
pname = "bambootracker"; pname = "bambootracker";
version = "0.4.3"; version = "0.4.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "rerrahkr"; owner = "rerrahkr";
repo = "BambooTracker"; repo = "BambooTracker";
rev = "v${version}"; rev = "v${version}";
sha256 = "0gq40qmsdavsyl2d6a71rwp4mjlwvp1c8bry32srn4hliwfnvqa6"; sha256 = "0d0f4jqzknsiq725pvfndarfjg183f92rb0lim3wzshnsixr5vdc";
}; };
# Fix macOS build until new release sourceRoot = "source/BambooTracker";
patches = [
(fetchpatch {
url = "https://github.com/rerrahkr/BambooTracker/commit/45346ed99559d44c2e32a5c6138a0835b212e875.patch";
sha256 = "1xkiqira1kpcqkacycy0y7qm1brhf89amliv42byijl4palmykh2";
})
];
preConfigure = "cd BambooTracker"; nativeBuildInputs = [ qmake qttools ];
nativeBuildInputs = [ qmake qttools installShellFiles ];
buildInputs = [ qtbase qtmultimedia ] buildInputs = [ qtbase qtmultimedia ]
++ optional alsaSupport alsaLib ++ optional alsaSupport alsaLib
@ -51,17 +41,6 @@ mkDerivation rec {
++ optional pulseSupport "CONFIG+=use_pulse" ++ optional pulseSupport "CONFIG+=use_pulse"
++ optionals jackSupport [ "CONFIG+=use_jack" "CONFIG+=jack_has_rename" ]; ++ optionals jackSupport [ "CONFIG+=use_jack" "CONFIG+=jack_has_rename" ];
postInstall = ''
install -Dm644 ../BambooTracker.desktop $out/share/applications/BambooTracker.desktop
installManPage ../BambooTracker*.1
cp -r ../{demos,licenses,skins,LICENSE} $out/share/BambooTracker/
for size in 16x16 256x256; do
install -Dm644 res/icon/icon_$size.png $out/share/icons/hicolor/$size/apps/BambooTracker.png
done
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A tracker for YM2608 (OPNA) which was used in NEC PC-8801/9801 series computers"; description = "A tracker for YM2608 (OPNA) which was used in NEC PC-8801/9801 series computers";
homepage = "https://github.com/rerrahkr/BambooTracker"; homepage = "https://github.com/rerrahkr/BambooTracker";

View File

@ -2,13 +2,13 @@
buildGoModule rec { buildGoModule rec {
pname = "dcrd"; pname = "dcrd";
version = "1.5.1"; version = "1.5.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "decred"; owner = "decred";
repo = "dcrd"; repo = "dcrd";
rev = "refs/tags/release-v${version}"; rev = "refs/tags/release-v${version}";
sha256 = "1ggw289y1f4dqvj3w60q9bahq8bblbfjymn5xy04ldylr3qlxm9x"; sha256 = "14pxajc8si90hnddilfm09kmljwxq6i6p53fk0g09jp000cbklkl";
}; };
vendorSha256 = "03aw6mcvp1vr01ppxy673jf5hdryd5032cxndlkaiwg005mxp1dy"; vendorSha256 = "03aw6mcvp1vr01ppxy673jf5hdryd5032cxndlkaiwg005mxp1dy";

View File

@ -42,7 +42,7 @@ assert withXwidgets -> withGTK3 && webkitgtk != null;
let let
in stdenv.mkDerivation { in stdenv.mkDerivation {
inherit pname version; inherit pname version patches;
src = fetchurl { src = fetchurl {
url = "mirror://gnu/emacs/${name}.tar.xz"; url = "mirror://gnu/emacs/${name}.tar.xz";

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, copyPathsToStore, lib, kdepimTeam, mkDerivation, lib, kdepimTeam,
extra-cmake-modules, shared-mime-info, extra-cmake-modules, shared-mime-info,
boost, kcompletion, kconfigwidgets, kcrash, kdbusaddons, kdesignerplugin, boost, kcompletion, kconfigwidgets, kcrash, kdbusaddons, kdesignerplugin,
ki18n, kiconthemes, kio, kitemmodels, kwindowsystem, mysql, qttools, ki18n, kiconthemes, kio, kitemmodels, kwindowsystem, mysql, qttools,

View File

@ -1 +1 @@
WGET_ARGS=(http://download.kde.org/stable/release-service/20.08.0/src) WGET_ARGS=(http://download.kde.org/stable/release-service/20.08.1/src)

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, copyPathsToStore, lib, kdepimTeam, mkDerivation, lib, kdepimTeam,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
grantlee, ki18n, kiconthemes, knewstuff, kservice, kxmlgui, qtbase, grantlee, ki18n, kiconthemes, knewstuff, kservice, kxmlgui, qtbase,
}: }:

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, copyPathsToStore, lib, kdepimTeam, mkDerivation, lib, kdepimTeam,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
akonadi, akonadi-contacts, grantlee, grantleetheme, kconfig, kconfigwidgets, akonadi, akonadi-contacts, grantlee, grantleetheme, kconfig, kconfigwidgets,
kcontacts, ki18n, kiconthemes, kio, libkleo, pimcommon, prison, kcontacts, ki18n, kiconthemes, kio, libkleo, pimcommon, prison,

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, copyPathsToStore, lib, kdepimTeam, mkDerivation, lib, kdepimTeam,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
shared-mime-info, shared-mime-info,
akonadi, akonadi-calendar, akonadi-contacts, akonadi-mime, akonadi-notes, akonadi, akonadi-calendar, akonadi-contacts, akonadi-mime, akonadi-notes,

File diff suppressed because it is too large Load Diff

View File

@ -3,13 +3,13 @@
mkDerivation rec { mkDerivation rec {
pname = "AusweisApp2"; pname = "AusweisApp2";
version = "1.20.1"; version = "1.20.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "Governikus"; owner = "Governikus";
repo = "AusweisApp2"; repo = "AusweisApp2";
rev = "${version}"; rev = "${version}";
sha256 = "17ify6v4z8i8ps3s8qabnrqfkj0my4yzyqwk3q3nhrqilbnhr40x"; sha256 = "1vibk3wmn54qr2mwz537hrr959y0r1zabp0gsijhzj2mk68g9pnb";
}; };
nativeBuildInputs = [ cmake pkgconfig ]; nativeBuildInputs = [ cmake pkgconfig ];

View File

@ -25,13 +25,7 @@ let
# use the latest 1.x release instead # use the latest 1.x release instead
py = python3.override { py = python3.override {
packageOverrides = self: super: { packageOverrides = self: super: {
dnspython = super.dnspython.overridePythonAttrs (oldAttrs: rec { dnspython = super.dnspython_1;
version = "1.16.0";
src = oldAttrs.src.override {
inherit version;
sha256 = "36c5e8e38d4369a08b6780b7f27d790a292b2b08eea01607865bf0936c558e01";
};
});
}; };
}; };

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, glibc, libGLU, libGL, freetype, glib, libSM, libICE, libXi, libXv { stdenv, fetchurl, glibc, libGLU, libGL, freetype, glib, libSM, libICE, libXi, libXv
, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11 , libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11
, zlib, fontconfig, dpkg, libproxy, libxml2, gstreamer, gst_all_1, dbus }: , zlib, fontconfig, dpkg, libproxy, libxml2, gst_all_1, dbus }:
let let
arch = arch =
@ -33,7 +33,6 @@ let
fontconfig fontconfig
libproxy libproxy
libxml2 libxml2
gstreamer
dbus dbus
gst_all_1.gstreamer gst_all_1.gstreamer
gst_all_1.gst-plugins-base gst_all_1.gst-plugins-base

View File

@ -0,0 +1,49 @@
From 2629af4ed00d7ca65359178203d80fb146901cdb Mon Sep 17 00:00:00 2001
From: Daniel Fullmer <danielrf12@gmail.com>
Date: Fri, 3 Jul 2020 21:00:45 -0700
Subject: [PATCH 1/2] Fix CMakeLists
---
CMakeLists.txt | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e218279..4341de9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,6 +57,7 @@ endif(JPEG_FOUND)
include(FindJasper)
if(JASPER_FOUND)
set(HAVE_JASPER_LIB 1)
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${JASPER_LIBRARY})
endif(JASPER_FOUND)
# paths from willuslib/wgs.c
@@ -71,9 +72,12 @@ else()
message(STATUS "Could NOT find ghostscript executable")
endif(GHOSTSCRIPT_EXECUTABLE)
-# willus.h
-# HAVE_GSL_LIB
-
+pkg_check_modules(GSL gsl)
+if(GSL_FOUND)
+ set(HAVE_GSL_LIB 1)
+ include_directories(SYSTEM ${GSL_INCLUDEDIR})
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GSL_LDFLAGS})
+endif(GSL_FOUND)
# libfreetype6 (>= 2.3.9), libjbig2dec0, libjpeg8 (>= 8c), libx11-6, libxext6, zlib1g (>= 1:1.2.0)
# MUPDF_STATIC_LDFLAGS misses mupdf-js-none, and doubles libs ...
@@ -85,7 +89,7 @@ if(MUPDF_FOUND)
include_directories(SYSTEM ${MUPDF_INCLUDEDIR})
message(STATUS "mupdf libraries: ${MUPDF_LDFLAGS}")
set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${MUPDF_LDFLAGS}
- -lmupdf-js-none -lopenjpeg -ljbig2dec -ljpeg -lfreetype
+
)
endif(MUPDF_FOUND)
--
2.27.0

View File

@ -1,5 +1,5 @@
{ stdenv, fetchzip, fetchurl, fetchpatch, cmake, pkgconfig { stdenv, runCommand, fetchzip, fetchurl, fetchpatch, fetchFromGitHub
, zlib, libpng , cmake, pkgconfig, zlib, libpng, makeWrapper
, enableGSL ? true, gsl , enableGSL ? true, gsl
, enableGhostScript ? true, ghostscript , enableGhostScript ? true, ghostscript
, enableMuPDF ? true, mupdf , enableMuPDF ? true, mupdf
@ -11,44 +11,132 @@
with stdenv.lib; with stdenv.lib;
stdenv.mkDerivation rec { # k2pdfopt is a pain to package. It requires modified versions of mupdf,
pname = "k2pdfopt"; # leptonica, and tesseract. Instead of shipping patches for these upstream
version = "2.51a"; # packages, k2pdfopt includes just the modified source files for these
# packages. The individual files from the {mupdf,leptonica,tesseract}_mod/
# directories are intended to replace the corresponding source files in the
# upstream packages, for a particular version of that upstream package.
#
# There are a few ways we could approach packaging these modified versions of
# mupdf, leptonica, and mupdf:
# 1) Override the upstream source with a new derivation that involves copying
# the modified source files from k2pdfopt and replacing the corresponding
# source files in the upstream packages. Since the files are intended for a
# particular version of the upstream package, this would not allow us to easily
# use updates to those packages in nixpkgs.
# 2) Manually produce patches which can be applied against the upstream
# project, and have the same effect as replacing those files. This is what I
# believe k2pdfopt should do this for us anyway. The benefit of creating and
# applying patches in this way is that minor updates (esp. security fixes) to
# upstream packages might still allow these patches to apply successfully.
# 3) Automatically produce these patches inside a nix derivation. This is the
# approach taken here, using the "mkPatch" provided below. This has the
# benefit of easier review and should hopefully be simpler to update in the
# future.
src = (fetchzip { let
url = "http://www.willus.com/k2pdfopt/src/k2pdfopt_v2.51_src.zip"; # Create a patch against src based on changes applied in patchCommands
sha256 = "133l7xkvi67s6sfk8cfh7rmavbsf7ib5fyksk1ci6b6sch3z2sw9"; mkPatch = { name, src, patchCommands }: runCommand "${name}-k2pdfopt.patch" { inherit src; } ''
}); source $stdenv/setup
unpackPhase
# Note: the v2.51a zip contains only files to be replaced in the v2.50 zip. orig=$sourceRoot
v251a_src = (fetchzip { new=$sourceRoot-modded
url = "http://www.willus.com/k2pdfopt/src/k2pdfopt_v2.51a_src.zip"; cp -r $orig/. $new/
sha256 = "0vvwblii7kgdwfxw8dzk6jbmz4dv94d7rkv18i60y8wkayj6yhl6";
});
postUnpack = '' pushd $new >/dev/null
cp -r ${v251a_src}/* $sourceRoot ${patchCommands}
popd >/dev/null
diff -Naur $orig $new > $out || true
''; '';
patches = [ ./k2pdfopt.patch ./k2pdfopt-mupdf-1.16.1.patch ]; pname = "k2pdfopt";
version = "2.53";
k2pdfopt_src = fetchzip {
url = "http://www.willus.com/${pname}/src/${pname}_v${version}_src.zip";
sha256 = "1fna8bg3pascjfc3hmc6xn0xi2yh7f1qp0d344mw9hqanbnykyy8";
};
in stdenv.mkDerivation rec {
inherit pname version;
src = k2pdfopt_src;
nativeBuildInputs = [ cmake pkgconfig ]; patches = [
./0001-Fix-CMakeLists.patch
];
postPatch = ''
substituteInPlace willuslib/bmpdjvu.c \
--replace "<djvu.h>" "<libdjvu/ddjvuapi.h>"
'';
nativeBuildInputs = [ cmake pkgconfig makeWrapper ];
buildInputs = buildInputs =
let let
# The patches below were constructed by taking the files from k2pdfopt in # We use specific versions of these sources below to match the versions
# the {mupdf,leptonica,tesseract}_mod/ directories, replacing the # used in the k2pdfopt source. Note that this does _not_ need to match the
# corresponding files in the respective source trees, resolving any errors # version used elsewhere in nixpkgs, since it is only used to create the
# with more recent versions of these depencencies, and running diff. # patch that can then be applied to the version in nixpkgs.
mupdf_modded = mupdf.overrideAttrs (attrs: { mupdf_patch = mkPatch {
patches = attrs.patches ++ [ ./mupdf.patch ]; # Last verified with mupdf 1.16.1 name = "mupdf";
src = fetchurl {
url = "https://mupdf.com/downloads/archive/mupdf-1.17.0-source.tar.gz";
sha256 = "13nl9nrcx2awz9l83mlv2psi1lmn3hdnfwxvwgwiwbxlkjl3zqq0";
};
patchCommands = ''
cp ${k2pdfopt_src}/mupdf_mod/{filter-basic,font,stext-device,string}.c ./source/fitz/
cp ${k2pdfopt_src}/mupdf_mod/pdf-* ./source/pdf/
'';
};
mupdf_modded = mupdf.overrideAttrs ({ patches ? [], ... }: {
patches = patches ++ [ mupdf_patch ];
# This function is missing in font.c, see font-win32.c
postPatch = ''
echo "void pdf_install_load_system_font_funcs(fz_context *ctx) {}" >> source/fitz/font.c
'';
}); });
leptonica_modded = leptonica.overrideAttrs (attrs: {
patches = [ ./leptonica.patch ]; # Last verified with leptonica 1.78.0 leptonica_patch = mkPatch {
name = "leptonica";
src = fetchurl {
url = "http://www.leptonica.org/source/leptonica-1.79.0.tar.gz";
sha256 = "1n004gv1dj3pq1fcnfdclvvx5nang80336aa67nvs3nnqp4ncn84";
};
patchCommands = "cp -r ${k2pdfopt_src}/leptonica_mod/. ./src/";
};
leptonica_modded = leptonica.overrideAttrs ({ patches ? [], ... }: {
patches = patches ++ [ leptonica_patch ];
}); });
tesseract_patch = mkPatch {
name = "tesseract";
src = fetchFromGitHub {
owner = "tesseract-ocr";
repo = "tesseract";
rev = "4.1.1";
sha256 = "1ca27zbjpx35nxh9fha410z3jskwyj06i5hqiqdc08s2d7kdivwn";
};
patchCommands = ''
cp ${k2pdfopt_src}/tesseract_mod/{baseapi,tesscapi,tesseract}.* src/api/
cp ${k2pdfopt_src}/tesseract_mod/{tesscapi,tessedit,tesseract}.* src/ccmain/
cp ${k2pdfopt_src}/tesseract_mod/dotproduct{avx,fma,sse}.* src/arch/
cp ${k2pdfopt_src}/tesseract_mod/{intsimdmatrixsse,simddetect}.* src/arch/
cp ${k2pdfopt_src}/tesseract_mod/{errcode,genericvector,mainblk,params,serialis,tessdatamanager,tess_version,tprintf,unicharset}.* src/ccutil/
cp ${k2pdfopt_src}/tesseract_mod/{input,lstmrecognizer}.* src/lstm/
cp ${k2pdfopt_src}/tesseract_mod/openclwrapper.* src/opencl/
'';
};
tesseract_modded = tesseract4.override { tesseract_modded = tesseract4.override {
tesseractBase = tesseract4.tesseractBase.overrideAttrs (_: { tesseractBase = tesseract4.tesseractBase.overrideAttrs ({ patches ? [], ... }: {
patches = [ ./tesseract.patch ]; # Last verified with tesseract 1.4 patches = patches ++ [ tesseract_patch ];
# Additional compilation fixes
postPatch = ''
echo libtesseract_api_la_SOURCES += tesscapi.cpp >> src/api/Makefile.am
substituteInPlace src/api/tesseract.h \
--replace "#include <leptonica.h>" "//#include <leptonica.h>"
'';
}); });
}; };
in in
@ -71,6 +159,10 @@ stdenv.mkDerivation rec {
install -D -m 755 k2pdfopt $out/bin/k2pdfopt install -D -m 755 k2pdfopt $out/bin/k2pdfopt
''; '';
preFixup = optionalString enableTesseract ''
wrapProgram $out/bin/k2pdfopt --set-default TESSDATA_PREFIX ${tesseract4}/share/tessdata
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Optimizes PDF/DJVU files for mobile e-readers (e.g. the Kindle) and smartphones"; description = "Optimizes PDF/DJVU files for mobile e-readers (e.g. the Kindle) and smartphones";
homepage = "http://www.willus.com/k2pdfopt"; homepage = "http://www.willus.com/k2pdfopt";

View File

@ -1,151 +0,0 @@
diff --git a/willuslib/wmupdf.c b/willuslib/wmupdf.c
index 81627ef..f14a96c 100644
--- a/willuslib/wmupdf.c
+++ b/willuslib/wmupdf.c
@@ -189,8 +189,6 @@ int wmupdf_remake_pdf(char *infile,char *outfile,WPDFPAGEINFO *pageinfo,int use_
pdf_write_opts.do_compress=1;
pdf_write_opts.do_linear=0;
pdf_write_opts.do_garbage=1; /* 2 and 3 don't work for this. */
- pdf_write_opts.continue_on_error=0;
- pdf_write_opts.errors=NULL;
write_failed=0;
wpdfpageinfo_sort(pageinfo);
xref=NULL;
@@ -1687,8 +1685,8 @@ WPDFOUTLINE *wpdfoutline_read_from_pdf_file(char *filename)
/* Sumatra version of MuPDF v1.4 -- use locally installed fonts */
pdf_install_load_system_font_funcs(ctx);
fz_try(ctx) { doc=fz_open_document(ctx,filename); }
- fz_catch(ctx)
- {
+ fz_catch(ctx)
+ {
fz_drop_context(ctx);
return(NULL);
}
@@ -1890,5 +1888,5 @@ static pdf_obj *pdf_new_string_utf8(fz_context *ctx,char *string)
willus_mem_free((double **)&utfbuf,funcname);
return(pdfobj);
}
-
+
#endif /* HAVE_MUPDF_LIB */
diff --git a/willuslib/wmupdfinfo.c b/willuslib/wmupdfinfo.c
index 5c7f38c..9b9e6fd 100644
--- a/willuslib/wmupdfinfo.c
+++ b/willuslib/wmupdfinfo.c
@@ -237,23 +237,22 @@ static void showglobalinfo(fz_context *ctx, globals *glo,char *filename)
pdf_obj *robj;
robj=pdf_resolve_indirect(ctx,obj);
- n=pdf_sprint_obj(ctx,NULL,0,robj,1);
- buf=malloc(n+2);
+ buf=pdf_sprint_obj(ctx,NULL,0,&n,robj,1,0);
if (buf==NULL)
{
fz_write_printf(ctx,out,"Info object (%d %d R):\n",pdf_to_num(ctx,obj),pdf_to_gen(ctx,obj));
- pdf_print_obj(ctx,out,robj,1);
+ pdf_print_obj(ctx,out,robj,1,0);
}
else
{
- pdf_sprint_obj(ctx,buf,n+2,robj,1);
+ pdf_sprint_obj(ctx,buf,n+2,&n,robj,1,0);
display_pdf_field(ctx,out,buf,"Title","TITLE");
display_pdf_field(ctx,out,buf,"CreationDate","CREATED");
display_pdf_field(ctx,out,buf,"ModDate","LAST MODIFIED");
display_pdf_field(ctx,out,buf,"Producer","PDF PRODUCER");
display_pdf_field(ctx,out,buf,"Creator","CREATOR");
display_file_size(ctx,out,filename);
- free(buf);
+ fz_free(ctx,buf);
}
}
if (glo->dims==1)
@@ -275,7 +274,7 @@ static void showglobalinfo(fz_context *ctx, globals *glo,char *filename)
if (obj)
{
fz_write_printf(ctx,out, "\nEncryption object (%d %d R):\n", pdf_to_num(ctx,obj), pdf_to_gen(ctx,obj));
- pdf_print_obj(ctx,out, pdf_resolve_indirect(ctx,obj), 1);
+ pdf_print_obj(ctx,out, pdf_resolve_indirect(ctx,obj), 1, 0);
}
}
@@ -396,7 +395,7 @@ gatherdimensions(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_
if (j < glo->dims)
return;
- glo->dim = fz_resize_array(ctx, glo->dim, glo->dims+1, sizeof(struct info));
+ glo->dim = fz_realloc_array(ctx, glo->dim, glo->dims+1, struct info);
glo->dims++;
glo->dim[glo->dims - 1].page = page;
@@ -441,7 +440,7 @@ gatherfonts(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_obj *
if (k < glo->fonts)
continue;
- glo->font = fz_resize_array(ctx, glo->font, glo->fonts+1, sizeof(struct info));
+ glo->font = fz_realloc_array(ctx, glo->font, glo->fonts+1, struct info);
glo->fonts++;
glo->font[glo->fonts - 1].page = page;
@@ -510,7 +509,7 @@ gatherimages(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_obj
if (k < glo->images)
continue;
- glo->image = fz_resize_array(ctx, glo->image, glo->images+1, sizeof(struct info));
+ glo->image = fz_realloc_array(ctx, glo->image, glo->images+1, struct info);
glo->images++;
glo->image[glo->images - 1].page = page;
@@ -568,7 +567,7 @@ gatherforms(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_obj *
if (k < glo->forms)
continue;
- glo->form = fz_resize_array(ctx, glo->form, glo->forms+1, sizeof(struct info));
+ glo->form = fz_realloc_array(ctx, glo->form, glo->forms+1, struct info);
glo->forms++;
glo->form[glo->forms - 1].page = page;
@@ -613,7 +612,7 @@ gatherpsobjs(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_obj
if (k < glo->psobjs)
continue;
- glo->psobj = fz_resize_array(ctx, glo->psobj, glo->psobjs+1, sizeof(struct info));
+ glo->psobj = fz_realloc_array(ctx, glo->psobj, glo->psobjs+1, struct info);
glo->psobjs++;
glo->psobj[glo->psobjs - 1].page = page;
@@ -656,7 +655,7 @@ gathershadings(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_ob
if (k < glo->shadings)
continue;
- glo->shading = fz_resize_array(ctx, glo->shading, glo->shadings+1, sizeof(struct info));
+ glo->shading = fz_realloc_array(ctx, glo->shading, glo->shadings+1, struct info);
glo->shadings++;
glo->shading[glo->shadings - 1].page = page;
@@ -724,7 +723,7 @@ gatherpatterns(fz_context *ctx, globals *glo, int page, pdf_obj *pageref, pdf_ob
if (k < glo->patterns)
continue;
- glo->pattern = fz_resize_array(ctx, glo->pattern, glo->patterns+1, sizeof(struct info));
+ glo->pattern = fz_realloc_array(ctx, glo->pattern, glo->patterns+1, struct info);
glo->patterns++;
glo->pattern[glo->patterns - 1].page = page;
@@ -1216,7 +1215,7 @@ void wmupdfinfo_get(char *filename,int *pagelist,char **buf)
if (fout==NULL)
return;
*/
-
+
ctx = fz_new_context(NULL, NULL, FZ_STORE_UNLIMITED);
if (!ctx)
{
@@ -1307,5 +1306,5 @@ static void date_convert(char *dst,char *src)
else if (src[i]!='\0')
sprintf(&dst[strlen(dst)]," %s",&src[i]);
}
-
+
#endif /* HAVE_MUPDF_LIB */

View File

@ -1,99 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a2378b..502c477 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,7 @@ endif(JPEG_FOUND)
include(FindJasper)
if(JASPER_FOUND)
set(HAVE_JASPER_LIB 1)
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${JASPER_LIBRARY})
endif(JASPER_FOUND)
# paths from willuslib/wgs.c
@@ -66,8 +67,12 @@ else()
message(STATUS "Could NOT find ghostscript executable")
endif(GHOSTSCRIPT_EXECUTABLE)
-# willus.h
-# HAVE_GSL_LIB
+pkg_check_modules(GSL gsl)
+if(GSL_FOUND)
+ set(HAVE_GSL_LIB 1)
+ include_directories(SYSTEM ${GSL_INCLUDEDIR})
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GSL_LDFLAGS})
+endif(GSL_FOUND)
# libfreetype6 (>= 2.3.9), libjbig2dec0, libjpeg8 (>= 8c), libx11-6, libxext6, zlib1g (>= 1:1.2.0)
@@ -80,7 +85,7 @@ if(MUPDF_FOUND)
include_directories(SYSTEM ${MUPDF_INCLUDEDIR})
message(STATUS "mupdf libraries: ${MUPDF_LDFLAGS}")
set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${MUPDF_LDFLAGS}
- -lmupdf-js-none -lopenjpeg -ljbig2dec -ljpeg -lfreetype
+
)
endif(MUPDF_FOUND)
@@ -91,9 +96,25 @@ if(DJVU_FOUND)
set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${DJVU_LDFLAGS})
endif(DJVU_FOUND)
-# HAVE_GOCR_LIB
-# HAVE_LEPTONICA_LIB
-# HAVE_TESSERACT_LIB
+find_library(GOCR_LIB NAMES Pgm2asc)
+if(GOCR_LIB)
+ set(HAVE_GOCR_LIB 1)
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${GOCR_LIB})
+endif(GOCR_LIB)
+
+pkg_check_modules(LEPTONICA lept)
+if(LEPTONICA_FOUND)
+ set(HAVE_LEPTONICA_LIB 1)
+ include_directories(SYSTEM ${LEPTONICA_INCLUDEDIR})
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${LEPTONICA_LDFLAGS})
+endif(LEPTONICA_FOUND)
+
+pkg_check_modules(TESSERACT tesseract)
+if(TESSERACT_FOUND)
+ set(HAVE_TESSERACT_LIB 1)
+ include_directories(SYSTEM ${TESSERACT_INCLUDEDIR})
+ set(K2PDFOPT_LIB ${K2PDFOPT_LIB} ${TESSERACT_LDFLAGS})
+endif(TESSERACT_FOUND)
# ---- Describe project
diff --git a/willuslib/CMakeLists.txt b/willuslib/CMakeLists.txt
index 463bbc9..8043db5 100644
--- a/willuslib/CMakeLists.txt
+++ b/willuslib/CMakeLists.txt
@@ -6,7 +6,7 @@ include_directories(..)
set(WILLUSLIB_SRC
ansi.c array.c bmp.c bmpdjvu.c bmpmupdf.c dtcompress.c filelist.c
fontdata.c fontrender.c gslpolyfit.c linux.c math.c mem.c ocr.c
- ocrjocr.c ocrtess.c pdfwrite.c point2d.c render.c strbuf.c string.c
+ ocrgocr.c ocrtess.c pdfwrite.c point2d.c render.c strbuf.c string.c
token.c wfile.c wgs.c wgui.c willusversion.c win.c winbmp.c
wincomdlg.c winmbox.c winshell.c wmupdf.c wmupdfinfo.c wpdf.c wsys.c
wzfile.c wleptonica.c
diff --git a/willuslib/ocrgocr.c b/willuslib/ocrgocr.c
index 6027e9a..fbe10f0 100644
--- a/willuslib/ocrgocr.c
+++ b/willuslib/ocrgocr.c
@@ -29,6 +29,8 @@
#ifdef HAVE_GOCR_LIB
#include <gocr.h>
+job_t *OCR_JOB;
+
/*
** bmp8 must be grayscale
** (x1,y1) and (x2,y2) from top left of bitmap
@@ -63,6 +65,7 @@ void gocr_single_word_from_bmp8(char *text,int maxlen,WILLUSBITMAP *bmp8,
h=y2-y1+1;
dh=h+bw*2;
job=&_job;
+ OCR_JOB=job;
job_init(job);
job_init_image(job);
// willus_mem_alloc_warn((void **)&job->src.p.p,w*h,funcname,10);

View File

@ -1,254 +0,0 @@
From 8c11a20925686855023df90ed477957c7d7fe91e Mon Sep 17 00:00:00 2001
From: Daniel Fullmer <danielrf12@gmail.com>
Date: Fri, 13 Sep 2019 15:54:21 -0400
Subject: [PATCH] Willus mod for k2pdfopt
---
src/allheaders.h | 4 ++
src/dewarp2.c | 106 ++++++++++++++++++++++++++++++++++++++++++-----
src/leptwin.c | 6 ++-
3 files changed, 104 insertions(+), 12 deletions(-)
diff --git a/src/allheaders.h b/src/allheaders.h
index e68eff1..b3cc729 100644
--- a/src/allheaders.h
+++ b/src/allheaders.h
@@ -669,6 +669,10 @@ LEPT_DLL extern L_DEWARPA * dewarpaReadMem ( const l_uint8 *data, size_t size );
LEPT_DLL extern l_ok dewarpaWrite ( const char *filename, L_DEWARPA *dewa );
LEPT_DLL extern l_ok dewarpaWriteStream ( FILE *fp, L_DEWARPA *dewa );
LEPT_DLL extern l_ok dewarpaWriteMem ( l_uint8 **pdata, size_t *psize, L_DEWARPA *dewa );
+/* WILLUS MOD */
+ LEPT_DLL extern l_int32 dewarpBuildPageModel_ex ( L_DEWARP *dew, const char *debugfile,l_int32 fit_order );
+ LEPT_DLL extern l_int32 dewarpFindVertDisparity_ex ( L_DEWARP *dew, PTAA *ptaa, l_int32 rotflag,l_int32 fit_order );
+ LEPT_DLL extern l_int32 dewarpBuildLineModel_ex ( L_DEWARP *dew, l_int32 opensize, const char *debugfile,l_int32 fit_order );
LEPT_DLL extern l_ok dewarpBuildPageModel ( L_DEWARP *dew, const char *debugfile );
LEPT_DLL extern l_ok dewarpFindVertDisparity ( L_DEWARP *dew, PTAA *ptaa, l_int32 rotflag );
LEPT_DLL extern l_ok dewarpFindHorizDisparity ( L_DEWARP *dew, PTAA *ptaa );
diff --git a/src/dewarp2.c b/src/dewarp2.c
index 220eec1..2e29500 100644
--- a/src/dewarp2.c
+++ b/src/dewarp2.c
@@ -144,9 +144,17 @@ static const l_float32 L_ALLOWED_W_FRACT = 0.05; /* no bigger */
* longest textlines.
* </pre>
*/
+/* WILLUS MOD */
l_ok
-dewarpBuildPageModel(L_DEWARP *dew,
- const char *debugfile)
+dewarpBuildPageModel(L_DEWARP *dew,const char *debugfile)
+{
+return(dewarpBuildPageModel_ex(dew,debugfile,2));
+}
+
+l_ok
+dewarpBuildPageModel_ex(L_DEWARP *dew,
+ const char *debugfile,
+ l_int32 fit_order)
{
l_int32 linecount, topline, botline, ret;
PIX *pixs, *pix1, *pix2, *pix3;
@@ -225,7 +233,7 @@ PTAA *ptaa1, *ptaa2;
/* Get the sampled vertical disparity from the textline centers.
* The disparity array will push pixels vertically so that each
* textline is flat and centered at the y-position of the mid-point. */
- if (dewarpFindVertDisparity(dew, ptaa2, 0) != 0) {
+ if (dewarpFindVertDisparity_ex(dew, ptaa2, 0, fit_order) != 0) {
L_WARNING("vertical disparity not built\n", procName);
ptaaDestroy(&ptaa2);
return 1;
@@ -290,13 +298,24 @@ PTAA *ptaa1, *ptaa2;
* a pdf. Non-pix debug output goes to /tmp.
* </pre>
*/
+/* WILLUS MOD */
l_ok
dewarpFindVertDisparity(L_DEWARP *dew,
PTAA *ptaa,
l_int32 rotflag)
{
+return(dewarpFindVertDisparity_ex(dew,ptaa,rotflag,2));
+}
+/* WILLUS MOD -- add cubic and quartic fits and ..._ex functions */
+l_int32
+dewarpFindVertDisparity_ex(L_DEWARP *dew,
+ PTAA *ptaa,
+ l_int32 rotflag,
+ l_int32 fit_order)
+{
l_int32 i, j, nlines, npts, nx, ny, sampling;
-l_float32 c0, c1, c2, x, y, midy, val, medval, meddev, minval, maxval;
+/* WILLUS MOD */
+l_float32 c0, c1, c2, c3, c4, x, y, midy, val, medval, meddev, minval, maxval;
l_float32 *famidys;
NUMA *nax, *nafit, *nacurve0, *nacurve1, *nacurves;
NUMA *namidy, *namidys, *namidysi;
@@ -304,11 +323,22 @@ PIX *pix1, *pix2, *pixcirc, *pixdb;
PTA *pta, *ptad, *ptacirc;
PTAA *ptaa0, *ptaa1, *ptaa2, *ptaa3, *ptaa4, *ptaa5, *ptaat;
FPIX *fpix;
+/* WILLUS MOD */
+l_int32 fit_order1,fit_order2;
PROCNAME("dewarpFindVertDisparity");
if (!dew)
return ERROR_INT("dew not defined", procName, 1);
+/* WILLUS MOD */
+ if (fit_order < 10)
+ fit_order1 = fit_order2 = fit_order;
+ else
+ {
+ fit_order1=fit_order % 10;
+ fit_order2=fit_order / 10;
+ fit_order2=fit_order2 % 10;
+ }
dew->vsuccess = 0;
if (!ptaa)
return ERROR_INT("ptaa not defined", procName, 1);
@@ -331,12 +361,32 @@ FPIX *fpix;
pixdb = (rotflag) ? pixRotateOrth(dew->pixs, 1) : pixClone(dew->pixs);
for (i = 0; i < nlines; i++) { /* for each line */
pta = ptaaGetPta(ptaa, i, L_CLONE);
- ptaGetQuadraticLSF(pta, &c2, &c1, &c0, NULL);
- numaAddNumber(nacurve0, c2);
+/* WILLUS MOD */
+if (fit_order1>3)
+ {
+ ptaGetQuarticLSF(pta, &c4, &c3, &c2, &c1, &c0, NULL);
+ numaAddNumber(nacurve0, c4);
+ }
+else if (fit_order1==3)
+ {
+ ptaGetCubicLSF(pta, &c3, &c2, &c1, &c0, NULL);
+ numaAddNumber(nacurve0, c3);
+ }
+else
+ {
+ ptaGetQuadraticLSF(pta, &c2, &c1, &c0, NULL);
+ numaAddNumber(nacurve0, c2);
+ }
ptad = ptaCreate(nx);
for (j = 0; j < nx; j++) { /* uniformly sampled in x */
x = j * sampling;
- applyQuadraticFit(c2, c1, c0, x, &y);
+/* WILLUS MOD */
+if (fit_order1>3)
+ applyQuarticFit(c4, c3, c2, c1, c0, x, &y);
+else if (fit_order1==3)
+ applyCubicFit(c3, c2, c1, c0, x, &y);
+else
+ applyQuadraticFit(c2, c1, c0, x, &y);
ptaAddPt(ptad, x, y);
}
ptaaAddPta(ptaa0, ptad, L_INSERT);
@@ -350,7 +400,13 @@ FPIX *fpix;
for (i = 0; i < nlines; i++) {
pta = ptaaGetPta(ptaa, i, L_CLONE);
ptaGetArrays(pta, &nax, NULL);
- ptaGetQuadraticLSF(pta, NULL, NULL, NULL, &nafit);
+/* WILLUS MOD */
+if (fit_order1>3)
+ptaGetQuarticLSF(pta, NULL, NULL, NULL, NULL, NULL, &nafit);
+else if (fit_order1==3)
+ptaGetCubicLSF(pta, NULL, NULL, NULL, NULL, &nafit);
+else
+ptaGetQuadraticLSF(pta, NULL, NULL, NULL, &nafit);
ptad = ptaCreateFromNuma(nax, nafit);
ptaaAddPta(ptaat, ptad, L_INSERT);
ptaDestroy(&pta);
@@ -494,11 +550,24 @@ FPIX *fpix;
ptaa5 = ptaaCreate(nx); /* uniformly sampled across full height of image */
for (j = 0; j < nx; j++) { /* for each column */
pta = ptaaGetPta(ptaa4, j, L_CLONE);
- ptaGetQuadraticLSF(pta, &c2, &c1, &c0, NULL);
+/* WILLUS MOD */
+/* Order higher than 2 can cause a little craziness here. */
+if (fit_order2>3)
+ ptaGetQuarticLSF(pta, &c4, &c3, &c2, &c1, &c0, NULL);
+else if (fit_order2==3)
+ ptaGetCubicLSF(pta, &c3, &c2, &c1, &c0, NULL);
+else
+ ptaGetQuadraticLSF(pta, &c2, &c1, &c0, NULL);
ptad = ptaCreate(ny);
for (i = 0; i < ny; i++) { /* uniformly sampled in y */
y = i * sampling;
- applyQuadraticFit(c2, c1, c0, y, &val);
+/* WILLUS MOD */
+if (fit_order2>3)
+ applyQuarticFit(c4, c3, c2, c1, c0, y, &val);
+else if (fit_order2==3)
+ applyCubicFit(c3, c2, c1, c0, y, &val);
+else
+ applyQuadraticFit(c2, c1, c0, y, &val);
ptaAddPt(ptad, y, val);
}
ptaaAddPta(ptaa5, ptad, L_INSERT);
@@ -1602,11 +1671,21 @@ FPIX *fpix;
* See notes there.
* </pre>
*/
+/* WILLUS MOD */
l_ok
dewarpBuildLineModel(L_DEWARP *dew,
l_int32 opensize,
const char *debugfile)
{
+return(dewarpBuildLineModel_ex(dew,opensize,debugfile,2));
+}
+
+l_int32
+dewarpBuildLineModel_ex(L_DEWARP *dew,
+ l_int32 opensize,
+ const char *debugfile,
+ l_int32 fit_order)
+{
char buf[64];
l_int32 i, j, bx, by, ret, nlines;
BOXA *boxa;
@@ -1695,6 +1774,8 @@ PTAA *ptaa1, *ptaa2;
/* Remove all lines that are not at least 0.75 times the length
* of the longest line. */
+/* WILLUS MOD */
+/*
ptaa2 = dewarpRemoveShortLines(pix, ptaa1, 0.75, DEBUG_SHORT_LINES);
if (debugfile) {
pix1 = pixConvertTo32(pix);
@@ -1704,6 +1785,8 @@ PTAA *ptaa1, *ptaa2;
pixDestroy(&pix1);
pixDestroy(&pix2);
}
+*/
+ptaa2=ptaa1;
ptaaDestroy(&ptaa1);
nlines = ptaaGetCount(ptaa2);
if (nlines < dew->minlines) {
@@ -1717,7 +1800,8 @@ PTAA *ptaa1, *ptaa2;
* centers. The disparity array will push pixels vertically
* so that each line is flat and centered at the y-position
* of the mid-point. */
- ret = dewarpFindVertDisparity(dew, ptaa2, 1 - i);
+/* WILLUS MOD */
+ ret = dewarpFindVertDisparity_ex(dew, ptaa2, 1 - i, fit_order);
/* If i == 0, move the result to the horizontal disparity,
* rotating it back by -90 degrees. */
diff --git a/src/leptwin.c b/src/leptwin.c
index 72643a0..573d33e 100644
--- a/src/leptwin.c
+++ b/src/leptwin.c
@@ -364,5 +364,9 @@ PIXCMAP *cmap;
return hBitmap;
}
-
+#else
+/* willus mod: Avoid weird issue with OS/X library archiver when there are no symbols */
+int leptwin_my_empty_func(void);
+int leptwin_my_empty_func(void)
+{return(0);}
#endif /* _WIN32 */
--
2.22.0

File diff suppressed because it is too large Load Diff

View File

@ -1,675 +0,0 @@
From 39aa8502eee7bb669a29d1a9b3bfe5c9595ad960 Mon Sep 17 00:00:00 2001
From: Daniel Fullmer <danielrf12@gmail.com>
Date: Fri, 13 Sep 2019 13:45:05 -0400
Subject: [PATCH] Willus mod changes from k2pdfopt
---
src/api/Makefile.am | 1 +
src/api/baseapi.cpp | 87 +++++++++++
src/api/baseapi.h | 3 +
src/api/tesscapi.cpp | 311 +++++++++++++++++++++++++++++++++++++
src/api/tesseract.h | 29 ++++
src/ccmain/tessedit.cpp | 5 +-
src/ccutil/ccutil.h | 7 +
src/ccutil/genericvector.h | 21 ++-
src/ccutil/mainblk.cpp | 17 +-
src/ccutil/params.cpp | 3 +-
src/ccutil/serialis.cpp | 3 +
src/ccutil/serialis.h | 2 +
src/lstm/input.cpp | 3 +
13 files changed, 488 insertions(+), 4 deletions(-)
create mode 100644 src/api/tesscapi.cpp
create mode 100644 src/api/tesseract.h
diff --git a/src/api/Makefile.am b/src/api/Makefile.am
index d9b76eb6..cd2dc30f 100644
--- a/src/api/Makefile.am
+++ b/src/api/Makefile.am
@@ -39,6 +39,7 @@ libtesseract_api_la_SOURCES += lstmboxrenderer.cpp
libtesseract_api_la_SOURCES += pdfrenderer.cpp
libtesseract_api_la_SOURCES += wordstrboxrenderer.cpp
libtesseract_api_la_SOURCES += renderer.cpp
+libtesseract_api_la_SOURCES += tesscapi.cpp
lib_LTLIBRARIES += libtesseract.la
libtesseract_la_LDFLAGS = $(LEPTONICA_LIBS) $(OPENCL_LDFLAGS) $(libarchive_LIBS)
diff --git a/src/api/baseapi.cpp b/src/api/baseapi.cpp
index 9245d07c..ea964ee6 100644
--- a/src/api/baseapi.cpp
+++ b/src/api/baseapi.cpp
@@ -215,6 +215,14 @@ TessBaseAPI::TessBaseAPI()
// Use the current locale if building debug code.
std::locale::global(std::locale(""));
#endif
+ const char *locale;
+ locale = std::setlocale(LC_ALL, nullptr);
+/* willus mod Remove assertions--taken care of in tesscapi.cpp */
+// ASSERT_HOST(!strcmp(locale, "C"));
+ locale = std::setlocale(LC_CTYPE, nullptr);
+// ASSERT_HOST(!strcmp(locale, "C"));
+ locale = std::setlocale(LC_NUMERIC, nullptr);
+// ASSERT_HOST(!strcmp(locale, "C"));
}
TessBaseAPI::~TessBaseAPI() {
@@ -1333,6 +1341,85 @@ static void AddBoxToTSV(const PageIterator* it, PageIteratorLevel level,
text->add_str_int("\t", bottom - top);
}
+/* willus mod */
+int TessBaseAPI::GetOCRWords(int **x00,int **y00,int **x11,int **y11,int **ybaseline0,
+ char **utf8words)
+
+ {
+ int iword,nwords,totlen,it8;
+ int *x0,*y0,*x1,*y1,*ybaseline;
+ char *tutf8;
+
+ ResultIterator *res_it = GetIterator();
+ /* Count words */
+ iword=0;
+ totlen=0;
+ while (!res_it->Empty(RIL_BLOCK))
+ {
+ if (res_it->Empty(RIL_WORD))
+ {
+ res_it->Next(RIL_WORD);
+ continue;
+ }
+ iword++;
+ STRING textstr=std::unique_ptr<const char[]>(res_it->GetUTF8Text(RIL_WORD)).get();
+ totlen+=strlen(textstr.string())+1;
+ res_it->Next(RIL_WORD);
+ }
+ nwords=iword;
+/*
+printf("\nnwords=%d, totlen=%d\n",nwords,totlen);
+*/
+ x0=(*x00)=(int *)malloc(sizeof(int)*5*nwords);
+ y0=(*y00)=&x0[nwords];
+ x1=(*x11)=&y0[nwords];
+ y1=(*y11)=&x1[nwords];
+ ybaseline=(*ybaseline0)=&y1[nwords];
+ tutf8=(*utf8words)=(char *)malloc(totlen);
+ iword=0;
+ it8=0;
+ res_it->Begin();
+ while (!res_it->Empty(RIL_BLOCK))
+ {
+ if (res_it->Empty(RIL_WORD))
+ {
+ res_it->Next(RIL_WORD);
+ continue;
+ }
+ STRING textstr=std::unique_ptr<const char[]>(res_it->GetUTF8Text(RIL_WORD)).get();
+ strcpy(&tutf8[it8],textstr.string());
+ it8 += strlen(&tutf8[it8])+1;
+ /*
+ STRING textstr("");
+ textstr += std::unique_ptr<const char[]>(res_it->GetUTF8Text(RIL_WORD)).get();
+ */
+/*
+printf("Word %d: '%s'\n",iword,textstr.string());
+*/
+ int left, top, right, bottom;
+ int u1,v1,u2,v2;
+ res_it->BoundingBox(RIL_WORD, &left, &top, &right, &bottom);
+ res_it->Baseline(RIL_WORD, &u1, &v1, &u2, &v2);
+ x0[iword]=left;
+ x1[iword]=right;
+ y0[iword]=top;
+ y1[iword]=bottom;
+ ybaseline[iword]=(v1+v2)/2;
+ iword++;
+/*
+printf("BB: (%d,%d)-(%d,%d) BL: (%d,%d)-(%d,%d)\n",left,bottom,right,top,x1,y1,x2,y2);
+*/
+ res_it->Next(RIL_WORD);
+ }
+/*
+printf("iword=%d\n",iword);
+*/
+ return(iword);
+ }
+
+/* willus mod */
+int GetOCRWords(int **x0,int **y0,int **x1,int **y1,int **ybaseline,char **utf8words);
+
/**
* Make a TSV-formatted string from the internal data structures.
* page_number is 0-based but will appear in the output as 1-based.
diff --git a/src/api/baseapi.h b/src/api/baseapi.h
index 3724dd92..23be5920 100644
--- a/src/api/baseapi.h
+++ b/src/api/baseapi.h
@@ -575,6 +575,9 @@ class TESS_API TessBaseAPI {
*/
char* GetHOCRText(ETEXT_DESC* monitor, int page_number);
+/* willus mod */
+int GetOCRWords(int **x0,int **y0,int **x1,int **y1,int **ybaseline,char **utf8words);
+
/**
* Make a HTML-formatted string with hOCR markup from the internal
* data structures.
diff --git a/src/api/tesscapi.cpp b/src/api/tesscapi.cpp
new file mode 100644
index 00000000..1752fafe
--- /dev/null
+++ b/src/api/tesscapi.cpp
@@ -0,0 +1,311 @@
+/*
+** tesscapi.cpp willus.com attempt at C wrapper for tesseract.
+** (Butchered from tesseractmain.cpp)
+** Last udpated 9-1-12
+**
+** Copyright (C) 2012 http://willus.com
+**
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU Affero General Public License for more details.
+**
+** You should have received a copy of the GNU Affero General Public License
+** along with this program. If not, see <http://www.gnu.org/licenses/>.
+**
+*/
+
+/*
+#include "mfcpch.h"
+*/
+// #define USE_VLD //Uncomment for Visual Leak Detector.
+#if (defined _MSC_VER && defined USE_VLD)
+#include <vld.h>
+#endif
+
+// Include automatically generated configuration file if running autoconf
+#ifdef HAVE_CONFIG_H
+#include "config_auto.h"
+#endif
+#include <locale.h>
+#ifdef USING_GETTEXT
+#include <libintl.h>
+#define _(x) gettext(x)
+#else
+#define _(x) (x)
+#endif
+
+#include "allheaders.h"
+#include "baseapi.h"
+#include "strngs.h"
+#include "params.h"
+#include "blobs.h"
+#include "simddetect.h"
+#include "tesseractclass.h"
+/*
+#include "notdll.h"
+*/
+
+/* C Wrappers */
+#include "tesseract.h"
+
+// static tesseract::TessBaseAPI api[4];
+
+/*
+** ocr_type=0: OEM_DEFAULT
+** ocr_type=1: OEM_TESSERACT_ONLY
+** ocr_type=2: OEM_LSTM_ONLY
+** ocr_type=3: OEM_TESSERACT_LSTM_COMBINED
+*/
+void *tess_capi_init(char *datapath,char *language,int ocr_type,FILE *out,
+ char *initstr,int maxlen,int *status)
+
+ {
+ char original_locale[256];
+ tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI;
+/*
+printf("@tess_capi_init\n");
+printf(" datapath='%s'\n",datapath);
+printf(" language='%s'\n",language);
+printf(" ocr_type=%d\n",ocr_type);
+*/
+#ifdef USE_NLS
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+#endif
+ /* willus mod, 11-24-16 */
+ /* Tesseract needs "C" locale to correctly parse all data .traineddata files. */
+/*
+printf("locale='%s'\n",setlocale(LC_ALL,NULL));
+printf("ctype='%s'\n",setlocale(LC_CTYPE,NULL));
+printf("numeric='%s'\n",setlocale(LC_NUMERIC,NULL));
+*/
+ strncpy(original_locale,setlocale(LC_ALL,NULL),255);
+ original_locale[255]='\0';
+/*
+printf("original_locale='%s'\n",original_locale);
+*/
+ setlocale(LC_ALL,"C");
+/*
+printf("new locale='%s'\n",setlocale(LC_ALL,NULL));
+printf("new ctype='%s'\n",setlocale(LC_CTYPE,NULL));
+printf("new numeric='%s'\n",setlocale(LC_NUMERIC,NULL));
+*/
+ // fprintf(stderr, "tesseract %s\n", tesseract::TessBaseAPI::Version());
+ // Make the order of args a bit more forgiving than it used to be.
+ const char* lang = "eng";
+ tesseract::PageSegMode pagesegmode = tesseract::PSM_SINGLE_BLOCK;
+ if (language!=NULL && language[0]!='\0')
+ lang = language;
+ /*
+ if (output == NULL)
+ {
+ fprintf(stderr, _("Usage:%s imagename outputbase [-l lang] "
+ "[-psm pagesegmode] [configfile...]\n"), argv[0]);
+ fprintf(stderr,
+ _("pagesegmode values are:\n"
+ "0 = Orientation and script detection (OSD) only.\n"
+ "1 = Automatic page segmentation with OSD.\n"
+ "2 = Automatic page segmentation, but no OSD, or OCR\n"
+ "3 = Fully automatic page segmentation, but no OSD. (Default)\n"
+ "4 = Assume a single column of text of variable sizes.\n"
+ "5 = Assume a single uniform block of vertically aligned text.\n"
+ "6 = Assume a single uniform block of text.\n"
+ "7 = Treat the image as a single text line.\n"
+ "8 = Treat the image as a single word.\n"
+ "9 = Treat the image as a single word in a circle.\n"
+ "10 = Treat the image as a single character.\n"));
+ fprintf(stderr, _("-l lang and/or -psm pagesegmode must occur before any"
+ "configfile.\n"));
+ exit(1);
+ }
+ */
+/*
+printf("SSE = %s\n",SIMDDetect::IsSSEAvailable() ? "AVAILABLE" : "NOT AVAILABLE");
+printf("AVX = %s\n",SIMDDetect::IsAVXAvailable() ? "AVAILABLE" : "NOT AVAILABLE");
+*/
+/*
+v4.00 loads either TESSERACT enginer, LSTM engine, or both. No CUBE.
+*/
+ ocr_type=0; /* Ignore specified and use default */
+ api->SetOutputName(NULL);
+ (*status)=api->Init(datapath,lang,
+ ocr_type==0 ? tesseract::OEM_DEFAULT :
+ (ocr_type==1 ? tesseract::OEM_TESSERACT_ONLY :
+ (ocr_type==2 ? tesseract::OEM_LSTM_ONLY :
+ (tesseract::OEM_TESSERACT_LSTM_COMBINED))));
+ if ((*status)!=0)
+ {
+ /* willus mod, 11-24-16 */
+ setlocale(LC_ALL,original_locale);
+ api->End();
+ delete api;
+ return(NULL);
+ }
+ /*
+ api.Init("tesscapi",lang,tesseract::OEM_DEFAULT,
+ &(argv[arg]), argc - arg, NULL, NULL, false);
+ */
+ // We have 2 possible sources of pagesegmode: a config file and
+ // the command line. For backwards compatability reasons, the
+ // default in tesseract is tesseract::PSM_SINGLE_BLOCK, but the
+ // default for this program is tesseract::PSM_AUTO. We will let
+ // the config file take priority, so the command-line default
+ // can take priority over the tesseract default, so we use the
+ // value from the command line only if the retrieved mode
+ // is still tesseract::PSM_SINGLE_BLOCK, indicating no change
+ // in any config file. Therefore the only way to force
+ // tesseract::PSM_SINGLE_BLOCK is from the command line.
+ // It would be simpler if we could set the value before Init,
+ // but that doesn't work.
+ if (api->GetPageSegMode() == tesseract::PSM_SINGLE_BLOCK)
+ api->SetPageSegMode(pagesegmode);
+
+ /*
+ ** Initialization message
+ */
+ {
+ char istr[1024];
+ int sse,avx;
+
+// printf("tessedit_ocr_engine_mode = %d\n",tessedit_ocr_engine_mode);
+ sprintf(istr,"%s",api->Version());
+ sse=tesseract::SIMDDetect::IsSSEAvailable();
+ avx=tesseract::SIMDDetect::IsAVXAvailable();
+ if (sse || avx)
+ sprintf(&istr[strlen(istr)]," [%s]",sse&&avx?"SSE+AVX":(sse?"SSE":"AVX"));
+ sprintf(&istr[strlen(istr)],"\n Tesseract data folder = '%s'",datapath==NULL?getenv("TESSDATA_PREFIX"):datapath);
+ strcat(istr,"\n Tesseract languages: ");
+ GenericVector<STRING> languages;
+ api->GetLoadedLanguagesAsVector(&languages);
+/*
+printf("OEM=%d\n",api->oem());
+printf("Langs='%s'\n",api->GetInitLanguagesAsString());
+printf("AnyTessLang()=%d\n",(int)api->tesseract()->AnyTessLang());
+printf("AnyLSTMLang()=%d\n",(int)api->tesseract()->AnyLSTMLang());
+printf("num_sub_langs()=%d\n",api->tesseract()->num_sub_langs());
+printf("languages.size()=%d\n",(int)languages.size());
+*/
+
+ for (int i=0;i<=api->tesseract()->num_sub_langs();i++)
+ {
+ tesseract::Tesseract *lang1;
+ int eng;
+ lang1 = i==0 ? api->tesseract() : api->tesseract()->get_sub_lang(i-1);
+ eng=(int)lang1->tessedit_ocr_engine_mode;
+ sprintf(&istr[strlen(istr)],"%s%s [%s]",i==0?"":", ",lang1->lang.string(),
+ eng==2?"LSTM+Tess":(eng==1?"LSTM":"Tess"));
+ }
+/*
+printf("%d. '%s'\n",i+1,languages[i].string());
+printf(" sublang[%d].oem_engine = %d\n",i+1,(int)api->tesseract()->get_sub_lang(i)->tessedit_ocr_engine_mode);
+*/
+
+ /*
+ if (ocr_type==0 || ocr_type==3)
+ sprintf(&istr[strlen(istr)],"[LSTM+] (lang=");
+ else if (ocr_type==2)
+ sprintf(&istr[strlen(istr)],"[LSTM] (lang=");
+ strncpy(&istr[strlen(istr)],language,253-strlen(istr));
+ istr[253]='\0';
+ strcat(istr,")");
+ */
+ if (out!=NULL)
+ fprintf(out,"%s\n",istr);
+ if (initstr!=NULL)
+ {
+ strncpy(initstr,istr,maxlen-1);
+ initstr[maxlen-1]='\0';
+ }
+ }
+
+
+ /* Turn off LSTM debugging output */
+ api->SetVariable("lstm_debug_level","0");
+#if (WILLUSDEBUG & 1)
+ api->SetVariable("lstm_debug_level","9");
+ api->SetVariable("paragraph_debug_level","9");
+ api->SetVariable("tessdata_manager_debug_level","9");
+ api->SetVariable("tosp_debug_level","9");
+ api->SetVariable("wordrec_debug_level","9");
+ api->SetVariable("segsearch_debug_level","9");
+#endif
+ /* willus mod, 11-24-16 */
+ setlocale(LC_ALL,original_locale);
+ return((void *)api);
+ }
+
+
+int tess_capi_get_ocr(void *vapi,PIX *pix,char *outstr,int maxlen,int segmode,FILE *out)
+
+ {
+ tesseract::TessBaseAPI *api;
+ static int old_segmode=-1;
+
+ api=(tesseract::TessBaseAPI *)vapi;
+ if (old_segmode != segmode)
+ {
+ old_segmode=segmode;
+ api->SetPageSegMode((tesseract::PageSegMode)segmode);
+ }
+ if (!api->ProcessPage(pix,0,NULL,NULL,0,NULL))
+ {
+ /* pixDestroy(&pix); */
+ if (out!=NULL)
+ fprintf(out,"tesscapi: Error during bitmap processing.\n");
+ api->Clear();
+ return(-1);
+ }
+ strncpy(outstr,api->GetUTF8Text(),maxlen-1);
+ outstr[maxlen-1]='\0';
+ api->Clear();
+ return(0);
+ }
+
+
+int tess_capi_get_ocr_multiword(void *vapi,PIX *pix,int segmode,
+ int **left,int **top,int **right,int **bottom,
+ int **ybase,char **text,int *nw,
+ FILE *out)
+
+ {
+ tesseract::TessBaseAPI *api;
+ static int old_segmode=-1;
+
+ api=(tesseract::TessBaseAPI *)vapi;
+ if (old_segmode != segmode)
+ {
+ old_segmode=segmode;
+ api->SetPageSegMode((tesseract::PageSegMode)segmode);
+ }
+ if (!api->ProcessPage(pix,0,NULL,NULL,0,NULL))
+ {
+ if (out!=NULL)
+ fprintf(out,"tesscapi: Error during bitmap processing.\n");
+ api->Clear();
+ (*nw)=0;
+ return(-1);
+ }
+ (*nw)=api->GetOCRWords(left,top,right,bottom,ybase,text);
+ api->Clear();
+ return(0);
+ }
+
+
+void tess_capi_end(void *vapi)
+
+ {
+ tesseract::TessBaseAPI *api;
+
+ if (vapi==NULL)
+ return;
+ api=(tesseract::TessBaseAPI *)vapi;
+ api->End();
+ delete api;
+ }
diff --git a/src/api/tesseract.h b/src/api/tesseract.h
new file mode 100644
index 00000000..575948cc
--- /dev/null
+++ b/src/api/tesseract.h
@@ -0,0 +1,29 @@
+/*
+** Willus.com's Tesseract C Wrappers
+**
+** 6-8-12
+**
+*/
+
+#ifndef _TESSERACT_H_
+#define _TESSERACT_H_
+
+//#include <leptonica.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void *tess_capi_init(char *datapath,char *language,int ocr_type,FILE *out,
+ char *initstr,int maxlen,int *status);
+int tess_capi_get_ocr(void *api,PIX *pix,char *outstr,int maxlen,int segmode,FILE *out);
+int tess_capi_get_ocr_multiword(void *vapi,PIX *pix,int segmode,
+ int **left,int **top,int **right,int **bottom,
+ int **ybase,char **text,int *nw,
+ FILE *out);
+void tess_capi_end(void *api);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/ccmain/tessedit.cpp b/src/ccmain/tessedit.cpp
index 17f0951b..7af94ee2 100644
--- a/src/ccmain/tessedit.cpp
+++ b/src/ccmain/tessedit.cpp
@@ -101,6 +101,10 @@ bool Tesseract::init_tesseract_lang_data(
" to your \"tessdata\" directory.\n");
return false;
}
+ /* willus mod */
+ TFile fp;
+ strncpy(fp.tfile_filename,tessdata_path.string(),511);
+ fp.tfile_filename[511]='\0';
#ifndef DISABLED_LEGACY_ENGINE
if (oem == OEM_DEFAULT) {
// Set the engine mode from availability, which can then be overridden by
@@ -116,7 +120,6 @@ bool Tesseract::init_tesseract_lang_data(
#endif // ndef DISABLED_LEGACY_ENGINE
// If a language specific config file (lang.config) exists, load it in.
- TFile fp;
if (mgr->GetComponent(TESSDATA_LANG_CONFIG, &fp)) {
ParamUtils::ReadParamsFromFp(SET_PARAM_CONSTRAINT_NONE, &fp,
this->params());
diff --git a/src/ccutil/ccutil.h b/src/ccutil/ccutil.h
index 71e89c60..bdeccc14 100644
--- a/src/ccutil/ccutil.h
+++ b/src/ccutil/ccutil.h
@@ -80,6 +80,13 @@ class CCUtil {
// Member parameters.
// These have to be declared and initialized after params_ member, since
// params_ should be initialized before parameters are added to it.
+/* willus mod */
+/*
+ #ifdef _WIN32
+ STRING_VAR_H(tessedit_module_name, WINDLLNAME,
+ "Module colocated with tessdata dir");
+ #endif
+*/
INT_VAR_H(ambigs_debug_level, 0, "Debug level for unichar ambiguities");
BOOL_VAR_H(use_definite_ambigs_for_classifier, false,
"Use definite ambiguities when running character classifier");
diff --git a/src/ccutil/genericvector.h b/src/ccutil/genericvector.h
index 3556d153..3a5e8662 100644
--- a/src/ccutil/genericvector.h
+++ b/src/ccutil/genericvector.h
@@ -382,7 +382,26 @@ inline bool LoadDataFromFile(const char* filename, GenericVector<char>* data) {
// reserve an extra byte in case caller wants to append a '\0' character
data->reserve(size + 1);
data->resize_no_init(size);
- result = static_cast<long>(fread(&(*data)[0], 1, size, fp)) == size;
+ /* willus mod Dec 2018--weird issue with Win XP and MinGW gcc 7.3.0 */
+ /* Can't read entire file at once -- need to break up into smaller blocksize reads */
+ {
+ int frs,n;
+ int blocksize;
+ blocksize=1024*1024;
+ for (n=0;1;)
+ {
+ int bs;
+ bs= size-n > blocksize ? blocksize : size-n;
+ frs=(int)fread(&(*data)[n],1,bs,fp);
+ n+=frs;
+ if (frs<bs || bs<blocksize || n>=size)
+ break;
+ }
+ result = static_cast<long>((long)n==size);
+ }
+ /*
+ result = static_cast<long>(fread(&(*data)[0], 1, size, fp)) == size;
+ */
}
fclose(fp);
}
diff --git a/src/ccutil/mainblk.cpp b/src/ccutil/mainblk.cpp
index 52b04b04..80b26044 100644
--- a/src/ccutil/mainblk.cpp
+++ b/src/ccutil/mainblk.cpp
@@ -55,8 +55,22 @@ void CCUtil::main_setup(const char *argv0, const char *basename) {
#if defined(_WIN32)
} else if (datadir == nullptr || _access(datadir.string(), 0) != 0) {
/* Look for tessdata in directory of executable. */
+ /*
+ char drive[_MAX_DRIVE];
+ char dir[_MAX_DIR];
+ */
char path[_MAX_PATH];
- DWORD length = GetModuleFileName(nullptr, path, sizeof(path));
+ int i;
+ /* DWORD length = */ GetModuleFileName(nullptr, path, sizeof(path));
+ /* willus mod--avoid _splitpath_s -- not in XP */
+ for (i=strlen(path)-1;i>=0 && path[i]!='/' && path[i]!='\\';i--);
+ if (i>=0)
+ {
+ path[i]='\0';
+ datadir=path;
+ datadir += "/tessdata";
+ }
+ /*
if (length > 0 && length < sizeof(path)) {
char* separator = std::strrchr(path, '\\');
if (separator != nullptr) {
@@ -65,6 +79,7 @@ void CCUtil::main_setup(const char *argv0, const char *basename) {
datadir += "/tessdata";
}
}
+ */
#endif /* _WIN32 */
#if defined(TESSDATA_PREFIX)
} else {
diff --git a/src/ccutil/params.cpp b/src/ccutil/params.cpp
index 00bf2563..486c5ce0 100644
--- a/src/ccutil/params.cpp
+++ b/src/ccutil/params.cpp
@@ -82,7 +82,8 @@ bool ParamUtils::ReadParamsFromFp(SetParamConstraint constraint, TFile *fp,
if (!foundit) {
anyerr = true; // had an error
- tprintf("Warning: Parameter not found: %s\n", line);
+ /* willus mod */
+ tprintf("Tesseract warning: Parameter %s not found in file %s.\n",line,fp->tfile_filename);
}
}
}
diff --git a/src/ccutil/serialis.cpp b/src/ccutil/serialis.cpp
index 7def011f..6107a494 100644
--- a/src/ccutil/serialis.cpp
+++ b/src/ccutil/serialis.cpp
@@ -201,6 +201,9 @@ bool TFile::Open(const STRING& filename, FileReader reader) {
offset_ = 0;
is_writing_ = false;
swap_ = false;
+ /* willus mod */
+ strncpy(tfile_filename,filename.string(),511);
+ tfile_filename[511]='\0';
if (reader == nullptr)
return LoadDataFromFile(filename, data_);
else
diff --git a/src/ccutil/serialis.h b/src/ccutil/serialis.h
index 095b9227..4cc8251e 100644
--- a/src/ccutil/serialis.h
+++ b/src/ccutil/serialis.h
@@ -77,6 +77,8 @@ class TFile {
public:
TFile();
~TFile();
+ /* willus mod */
+ char tfile_filename[512];
// All the Open methods load the whole file into memory for reading.
// Opens a file with a supplied reader, or nullptr to use the default.
diff --git a/src/lstm/input.cpp b/src/lstm/input.cpp
index 73b584b3..0b0b54c3 100644
--- a/src/lstm/input.cpp
+++ b/src/lstm/input.cpp
@@ -93,8 +93,11 @@ Pix* Input::PrepareLSTMInputs(const ImageData& image_data,
return nullptr;
}
if (width < min_width || height < min_width) {
+ /* willus mod -- no warning */
+ /*
tprintf("Image too small to scale!! (%dx%d vs min width of %d)\n", width,
height, min_width);
+ */
pixDestroy(&pix);
return nullptr;
}
--
2.22.0

View File

@ -0,0 +1,48 @@
{ cmake
, fetchFromGitHub
, lib
, libusb1
, mkDerivation
, python3
, qtbase
, qttools
, udev
, zlib
}:
mkDerivation rec {
pname = "openambit";
version = "0.5";
src = fetchFromGitHub {
owner = "openambitproject";
repo = pname;
rev = version;
sha256 = "1074kvkamwnlkwdajsw1799wddcfkjh2ay6l842r0s4cvrxrai85";
};
nativeBuildInputs = [ cmake qttools ];
buildInputs = [ libusb1 python3 qtbase udev zlib ];
cmakeFlags = [ "-DCMAKE_INSTALL_UDEVRULESDIR=${placeholder "out"}/lib/udev/rules.d" ];
doInstallCheck = true;
installCheckPhase = ''
$out/bin/openambit --version
'';
postInstall = ''
install -m755 -D $src/tools/openambit2gpx.py $out/bin/openambit2gpx
mv -v $out/lib/udev/rules.d/libambit.rules \
$out/lib/udev/rules.d/20-libambit.rules
'';
meta = with lib; {
description = "Helps fetch data from Suunto Ambit GPS watches";
homepage = "https://github.com/openambitproject/openambit/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ rycee ];
platforms = platforms.linux;
};
}

View File

@ -2,16 +2,16 @@
buildGoModule rec { buildGoModule rec {
pname = "amfora"; pname = "amfora";
version = "1.4.0"; version = "1.5.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "makeworld-the-better-one"; owner = "makeworld-the-better-one";
repo = "amfora"; repo = "amfora";
rev = "v${version}"; rev = "v${version}";
sha256 = "1z4r1yqy5nkfa7yqcsqpqfdcghw8idryzb3s6d6ibca47r0qlcvw"; sha256 = "011h5xzwiafh3fdp9wil8n618p45ph9swa66lw6s82ijpiizz79s";
}; };
vendorSha256 = "0xj2s14dq10fwqqxjn4d8x6zljd5d15gjbja2gb75rfv09s4fdgv"; vendorSha256 = "10f3bh3r3jc1185r8r1ihg8rprdpl8qwg5b6wqwsda96ydkbpi2b";
doCheck = false; doCheck = false;

View File

@ -19,13 +19,13 @@ let
in in
buildGoModule rec { buildGoModule rec {
pname = "argo"; pname = "argo";
version = "2.10.0"; version = "2.10.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "argoproj"; owner = "argoproj";
repo = "argo"; repo = "argo";
rev = "v${version}"; rev = "v${version}";
sha256 = "19z1v6p59pcl8smywn1b5igqpv9wj48n6500wjxx5ayhc4mg00h2"; sha256 = "1k023rq4p0hvq5famxm83csp3zsijrki8myk6v83xyfigwxc8sia";
}; };
vendorSha256 = "0fqdxs3r4249qxlc9cac0lpbqf2aifkcah07v0cckb9rxfyiwhjz"; vendorSha256 = "0fqdxs3r4249qxlc9cac0lpbqf2aifkcah07v0cckb9rxfyiwhjz";

View File

@ -0,0 +1,25 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "cordless";
version = "2020-08-30";
src = fetchFromGitHub {
owner = "Bios-Marcel";
repo = pname;
rev = version;
sha256 = "sha256-CwOI7Ah4+sxD9We+Va5a6jYat5mjOeBk2EsOfwskz6k=";
};
subPackages = [ "." ];
vendorSha256 = "sha256-01I7GrZkaskuz20kVK2YwqvP7ViPMlQ3BFaoLHwgvOE=";
meta = with stdenv.lib; {
homepage = "https://github.com/Bios-Marcel/cordless";
description = "Discord terminal client";
license = licenses.bsd3;
maintainers = with maintainers; [ colemickens ];
platforms = platforms.unix;
};
}

View File

@ -6,6 +6,7 @@
, speechdSupport ? false, speechd ? null , speechdSupport ? false, speechd ? null
, pulseSupport ? false, libpulseaudio ? null , pulseSupport ? false, libpulseaudio ? null
, iceSupport ? false, zeroc-ice ? null , iceSupport ? false, zeroc-ice ? null
, grpcSupport ? false, grpc ? null, c-ares ? null, abseil-cpp ? null, which ? null
, nixosTests , nixosTests
}: }:
@ -13,6 +14,7 @@ assert jackSupport -> libjack2 != null;
assert speechdSupport -> speechd != null; assert speechdSupport -> speechd != null;
assert pulseSupport -> libpulseaudio != null; assert pulseSupport -> libpulseaudio != null;
assert iceSupport -> zeroc-ice != null; assert iceSupport -> zeroc-ice != null;
assert grpcSupport -> (grpc != null && c-ares != null && abseil-cpp != null && which != null);
with stdenv.lib; with stdenv.lib;
let let
@ -117,9 +119,12 @@ let
configureFlags = [ configureFlags = [
"CONFIG+=no-client" "CONFIG+=no-client"
] ++ optional (!iceSupport) "CONFIG+=no-ice"; ] ++ optional (!iceSupport) "CONFIG+=no-ice"
++ optional grpcSupport "CONFIG+=grpc";
buildInputs = [ libcap ] ++ optional iceSupport zeroc-ice; buildInputs = [ libcap ]
++ optional iceSupport zeroc-ice
++ optionals grpcSupport [ grpc c-ares abseil-cpp which ];
installPhase = '' installPhase = ''
# bin stuff # bin stuff

View File

@ -1,17 +1,17 @@
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages, installShellFiles }: { stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
buildGoPackage rec { buildGoModule rec {
pname = "rclone"; pname = "rclone";
version = "1.52.3"; version = "1.53.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = pname; owner = pname;
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "1bf3rhs4dcb8vkzs4a6pk5xrhnkhqsrbf4xrhcqf407r668gdav1"; sha256 = "1736np95di9ksy6i8glzmvzc7qp4d06354gvrnxbzimgf0mm11wn";
}; };
goPackagePath = "github.com/rclone/rclone"; vendorSha256 = "1l4iz31k1pylvf0zrp4nhxna70s1ma4981x6q1s3dhszjxil5c88";
subPackages = [ "." ]; subPackages = [ "." ];
@ -19,6 +19,8 @@ buildGoPackage rec {
nativeBuildInputs = [ installShellFiles ]; nativeBuildInputs = [ installShellFiles ];
buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
postInstall = postInstall =
let let
rcloneBin = rcloneBin =
@ -26,13 +28,13 @@ buildGoPackage rec {
then "$out" then "$out"
else stdenv.lib.getBin buildPackages.rclone; else stdenv.lib.getBin buildPackages.rclone;
in in
'' ''
installManPage $src/rclone.1 installManPage rclone.1
for shell in bash zsh fish; do for shell in bash zsh fish; do
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell ${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
installShellCompletion rclone.$shell installShellCompletion rclone.$shell
done done
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Command line program to sync files and directories to and from major cloud storage"; description = "Command line program to sync files and directories to and from major cloud storage";

View File

@ -14,16 +14,16 @@
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "espanso"; pname = "espanso";
version = "0.7.0"; version = "0.7.1";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "federico-terzi"; owner = "federico-terzi";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "11xdnn1iwpx58s3wvjb6dkgfc6dzsblzb6fngc0np5vx8r2pccpg"; sha256 = "1yspycgmg7vwf4d86r6n24lvgn14aq73fl8sn00shxndramp46ib";
}; };
cargoSha256 = "1yjpqjfrixscg52yhalybgp734w3sdqg5hxka8ppcvz7lp3w5b1s"; cargoSha256 = "0g0xf8j4yjayl7a5sqxm3piiif1hc7ws3i7q8vi7dk8nk609pbxr";
nativeBuildInputs = [ nativeBuildInputs = [
extra-cmake-modules extra-cmake-modules

View File

@ -50,9 +50,16 @@ python3Packages.buildPythonApplication rec {
liblarch liblarch
]; ];
checkInputs = with python3Packages; [
nose
mock
];
format = "other"; format = "other";
strictDeps = false; # gobject-introspection does not run with strictDeps (https://github.com/NixOS/nixpkgs/issues/56943) strictDeps = false; # gobject-introspection does not run with strictDeps (https://github.com/NixOS/nixpkgs/issues/56943)
checkPhase = "python3 ../run-tests";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = " A personal tasks and TODO-list items organizer."; description = " A personal tasks and TODO-list items organizer.";
longDescription = '' longDescription = ''

View File

@ -1,6 +1,13 @@
{ stdenv, kdeIntegration, ... }: { stdenv, kdeIntegration, fetchpatch, ... }:
attrs: attrs:
{ {
patches = attrs.patches or [ ] ++ [
(fetchpatch {
url = "https://git.pld-linux.org/gitweb.cgi?p=packages/libreoffice.git;a=blob_plain;f=poppler-0.86.patch;h=76b8356d5f22ef537a83b0f9b0debab591f152fe;hb=a2737a61353e305a9ee69640fb20d4582c218008";
name = "poppler-0.86.patch";
sha256 = "0q6k4l8imgp8ailcv0qx5l83afyw44hah24fi7gjrm9xgv5sbb8j";
})
];
postConfigure = attrs.postConfigure + '' postConfigure = attrs.postConfigure + ''
sed -e '/CPPUNIT_TEST(Import_Export_Import);/d' -i './sw/qa/extras/inc/swmodeltestbase.hxx' sed -e '/CPPUNIT_TEST(Import_Export_Import);/d' -i './sw/qa/extras/inc/swmodeltestbase.hxx'
''; '';

View File

@ -1,6 +1,7 @@
{ stdenv, fetchurl, wrapGAppsHook, makeDesktopItem { stdenv, fetchurl, wrapGAppsHook, makeDesktopItem
, atk , atk
, cairo , cairo
, coreutils
, curl , curl
, cups , cups
, dbus-glib , dbus-glib
@ -131,6 +132,12 @@ stdenv.mkDerivation rec {
"$out/usr/lib/zotero-bin-${version}/{}" \; "$out/usr/lib/zotero-bin-${version}/{}" \;
''; '';
preFixup = ''
gappsWrapperArgs+=(
--prefix PATH : ${stdenv.lib.makeBinPath [ coreutils ]}
)
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = "https://www.zotero.org"; homepage = "https://www.zotero.org";
description = "Collect, organize, cite, and share your research sources"; description = "Collect, organize, cite, and share your research sources";

View File

@ -3,7 +3,7 @@
, faad2, rtl-sdr, soapysdr-with-plugins, libusb-compat-0_1, fftwSinglePrec, lame, mpg123 }: , faad2, rtl-sdr, soapysdr-with-plugins, libusb-compat-0_1, fftwSinglePrec, lame, mpg123 }:
let let
version = "2.1"; version = "2.2";
in mkDerivation { in mkDerivation {
@ -14,7 +14,7 @@ in mkDerivation {
owner = "AlbrechtL"; owner = "AlbrechtL";
repo = "welle.io"; repo = "welle.io";
rev = "v${version}"; rev = "v${version}";
sha256 = "1j63gdbd66d6rfjsxwdm2agrcww1rs4438kg7313h6zixpcc1icj"; sha256 = "04fpm6sc431dl9i5h53xpd6k85j22sv8aawl7b6wv2fzpfsd9fwa";
}; };
nativeBuildInputs = [ cmake pkgconfig ]; nativeBuildInputs = [ cmake pkgconfig ];

View File

@ -2,13 +2,13 @@
buildGoPackage rec { buildGoPackage rec {
pname = "git-lfs"; pname = "git-lfs";
version = "2.11.0"; version = "2.12.0";
src = fetchFromGitHub { src = fetchFromGitHub {
rev = "v${version}"; rev = "v${version}";
owner = "git-lfs"; owner = "git-lfs";
repo = "git-lfs"; repo = "git-lfs";
sha256 = "05qd96bn2cl7gn5qarbcv6scdpj28qiwdfzalamqk5jjiidpmng5"; sha256 = "0pyvlcy6jxh0vzpsmywlbzwwdyj3jkcclnqb6sg786mmwrnqzj88";
}; };
goPackagePath = "github.com/git-lfs/git-lfs"; goPackagePath = "github.com/git-lfs/git-lfs";
@ -30,6 +30,7 @@ buildGoPackage rec {
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Git extension for versioning large files"; description = "Git extension for versioning large files";
homepage = "https://git-lfs.github.com/"; homepage = "https://git-lfs.github.com/";
changelog = "https://github.com/git-lfs/git-lfs/releases/tag/v${version}";
license = [ licenses.mit ]; license = [ licenses.mit ];
maintainers = [ maintainers.twey maintainers.marsam ]; maintainers = [ maintainers.twey maintainers.marsam ];
}; };

View File

@ -4,13 +4,13 @@ let
common = opts: callPackage (import ./common.nix opts); common = opts: callPackage (import ./common.nix opts);
in { in {
sublime-merge = common { sublime-merge = common {
buildVersion = "2020"; buildVersion = "2033";
sha256 = "0r5qqappaiicc4srk08az2vx42m7b6a75yn2ji5pv4w4085hlrzp"; sha256 = "1ym806df2hsw1ml932mshlw7cdxfi6jwa3mkh5m7gbmn7qwpm4xb";
} {}; } {};
sublime-merge-dev = common { sublime-merge-dev = common {
buildVersion = "2022"; buildVersion = "2031";
sha256 = "0fhxz6nx24wbspn7vfli3pvfv6fdbd591m619pvivig3scpidj61"; sha256 = "1vv3qcggicy5fb4nm2k5a6nw1f20cwxgrmn3xv2dvgx7mpzbhknp";
dev = true; dev = true;
} {}; } {};
} }

View File

@ -0,0 +1,71 @@
{ lib
, mkDerivation
, fetchFromGitHub
, fetchpatch
, pkg-config
, qmake
, qttools
, gstreamer
, libX11
, qtbase
, qtmultimedia
, qtx11extras
, gst-plugins-base
, gst-plugins-good
, gst-plugins-bad
, gst-plugins-ugly
}:
mkDerivation rec {
pname = "vokoscreen-ng";
version = "3.0.5";
src = fetchFromGitHub {
owner = "vkohaupt";
repo = "vokoscreenNG";
rev = version;
sha256 = "1spyqw8h8bkc1prdb9aixiw5h3hk3gp2p0nj934bnwq04kmfp660";
};
patches = [
# Better linux integration
(fetchpatch {
url = "https://github.com/vkohaupt/vokoscreenNG/commit/0a3784095ecca582f7eb09551ceb34c309d83637.patch";
sha256 = "1iibimv8xfxxfk44kkbrkay37ibdndjvs9g53mxr8x8vrsp917bz";
})
];
qmakeFlags = [ "src/vokoscreenNG.pro" ];
nativeBuildInputs = [ qttools pkg-config qmake ];
buildInputs = [
gstreamer
libX11
qtbase
qtmultimedia
qtx11extras
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
];
postPatch = ''
substituteInPlace src/vokoscreenNG.pro \
--replace lrelease-qt5 lrelease
'';
postInstall = ''
qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
'';
meta = with lib; {
description = "User friendly Open Source screencaster for Linux and Windows";
license = licenses.gpl2Plus;
homepage = "https://github.com/vkohaupt/vokoscreenNG";
maintainers = with maintainers; [ shamilton ];
platforms = platforms.linux;
};
}

View File

@ -1,6 +1,6 @@
{ stdenv, fetchFromGitHub, pkgconfig, libxcb, mkDerivation, qmake { stdenv, fetchFromGitHub, pkgconfig, libxcb, mkDerivation, qmake
, qtbase, qtdeclarative, qtquickcontrols, qtquickcontrols2 , qtbase, qtdeclarative, qtquickcontrols, qtquickcontrols2
, ffmpeg-full, gstreamer, gst_all_1, libpulseaudio, alsaLib, jack2 , ffmpeg-full, gst_all_1, libpulseaudio, alsaLib, jack2
, v4l-utils }: , v4l-utils }:
mkDerivation rec { mkDerivation rec {
pname = "webcamoid"; pname = "webcamoid";
@ -17,7 +17,7 @@ mkDerivation rec {
libxcb libxcb
qtbase qtdeclarative qtquickcontrols qtquickcontrols2 qtbase qtdeclarative qtquickcontrols qtquickcontrols2
ffmpeg-full ffmpeg-full
gstreamer gst_all_1.gst-plugins-base gst_all_1.gstreamer gst_all_1.gst-plugins-base
alsaLib libpulseaudio jack2 alsaLib libpulseaudio jack2
v4l-utils v4l-utils
]; ];

View File

@ -163,7 +163,6 @@ rec {
SDL_mixer SDL_mixer
SDL2_ttf SDL2_ttf
SDL2_mixer SDL2_mixer
gstreamer
libappindicator-gtk2 libappindicator-gtk2
libcaca libcaca
libcanberra libcanberra

View File

@ -1,7 +1,7 @@
{ lib, fetchzip }: { lib, fetchzip }:
let let
version = "1.062"; version = "1.064";
in in
fetchzip { fetchzip {
name = "recursive-${version}"; name = "recursive-${version}";
@ -15,7 +15,7 @@ fetchzip {
unzip -j $downloadedFile \*.woff2 -d $out/share/fonts/woff2 unzip -j $downloadedFile \*.woff2 -d $out/share/fonts/woff2
''; '';
sha256 = "06qilfa0c897shh7m7rpwia02nay8cjwnizzzba27ylzy5pwd96r"; sha256 = "1pbrqk848nkaambvsz0n8f88xdm8hyib83in27rmal739qh9d1z6";
meta = with lib; { meta = with lib; {
homepage = "https://recursive.design/"; homepage = "https://recursive.design/";

View File

@ -0,0 +1,46 @@
{ stdenv
, fetchFromGitHub
, gdk-pixbuf
, gtk-engine-murrine
, gtk_engines
, librsvg
}:
stdenv.mkDerivation rec {
pname = "marwaita-manjaro";
version = "2020-08-29";
src = fetchFromGitHub {
owner = "darkomarko42";
repo = pname;
rev = "d97e852931732ae5134784d11b332eadd71b6bbf";
sha256 = "1qa2mlc6k82i4fkgbkahjz3fhghcf8rx1ayxw0r4xl21mkna7bfy";
};
buildInputs = [
gdk-pixbuf
gtk_engines
librsvg
];
propagatedUserEnvPkgs = [
gtk-engine-murrine
];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/share/themes
cp -a Marwaita* $out/share/themes
runHook postInstall
'';
meta = with stdenv.lib; {
description = "Manjaro Style (green version) of Marwaita GTK theme";
homepage = "https://www.pling.com/p/1351213/";
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = [ maintainers.romildo ];
};
}

View File

@ -3,13 +3,13 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "yaru"; pname = "yaru";
version = "20.10.1"; version = "20.10.2";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "ubuntu"; owner = "ubuntu";
repo = "yaru"; repo = "yaru";
rev = version; rev = version;
sha256 = "08zws1qwvfr126fgdkqxxmpsqgfk02s31n90555bd5d66cfgdh72"; sha256 = "0vxs17nbahrdix1q9xj06nflm344lfgj2mrafsvyfcr2isn61iv6";
}; };
nativeBuildInputs = [ meson sassc pkg-config glib ninja python3 ]; nativeBuildInputs = [ meson sassc pkg-config glib ninja python3 ];

View File

@ -191,8 +191,10 @@ stdenv.mkDerivation rec {
''; '';
postFixup = '' postFixup = ''
# EFL applications depend on libcurl, which is linked at runtime by hand in code (it is dlopened) # Some libraries are linked at runtime by hand in code (they are dlopened)
patchelf --add-needed ${curl.out}/lib/libcurl.so $out/lib/libecore_con.so patchelf --add-needed ${curl.out}/lib/libcurl.so $out/lib/libecore_con.so
patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/libecore_audio.so
patchelf --add-needed ${libsndfile.out}/lib/libsndfile.so $out/lib/libecore_audio.so
''; '';
meta = { meta = {

View File

@ -21,6 +21,10 @@ stdenv.mkDerivation rec {
mesa mesa
]; ];
mesonFlags = [
"-D edje-cc=${efl}/bin/edje_cc"
];
meta = { meta = {
description = "Powerful terminal emulator based on EFL"; description = "Powerful terminal emulator based on EFL";
homepage = "https://www.enlightenment.org/about-terminology"; homepage = "https://www.enlightenment.org/about-terminology";

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgconfig, glib, gnome2, dbus-glib, gmime, gnome-icon-theme, libnotify, libgnome-keyring, openssl, cyrus_sasl, gnonlin, sylpheed, gob2, gettext, intltool, libxml2, hicolor-icon-theme, tango-icon-theme }: { stdenv, fetchFromGitHub, pkgconfig, glib, gnome2, dbus-glib, gmime, gnome-icon-theme, libnotify, libgnome-keyring, openssl, cyrus_sasl, sylpheed, gob2, gettext, intltool, libxml2, hicolor-icon-theme, tango-icon-theme }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
rev = "9ae8768"; rev = "9ae8768";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib dbus-glib gmime libnotify libgnome-keyring openssl cyrus_sasl gnonlin sylpheed gob2 gettext intltool gnome2.GConf gnome2.libgnomeui dbus-glib gmime libnotify gnome2.scrollkeeper libxml2 gnome-icon-theme hicolor-icon-theme tango-icon-theme ]; buildInputs = [ glib dbus-glib gmime libnotify libgnome-keyring openssl cyrus_sasl sylpheed gob2 gettext intltool gnome2.GConf gnome2.libgnomeui dbus-glib gmime libnotify gnome2.scrollkeeper libxml2 gnome-icon-theme hicolor-icon-theme tango-icon-theme ];
prePatch = '' prePatch = ''
sed -i -e '/jb_rule_set_install_message/d' -e '/jb_rule_add_install_command/d' jbsrc/jb.c sed -i -e '/jb_rule_set_install_message/d' -e '/jb_rule_add_install_command/d' jbsrc/jb.c

View File

@ -1,7 +1,6 @@
{ {
mkDerivation, mkDerivation,
lib, lib,
copyPathsToStore,
extra-cmake-modules, extra-cmake-modules,
plymouth, plymouth,
nixos-icons, nixos-icons,
@ -28,7 +27,9 @@ mkDerivation {
name = "breeze-plymouth"; name = "breeze-plymouth";
nativeBuildInputs = [ extra-cmake-modules ] ++ lib.optionals (logoFile != null) [ imagemagick netpbm perl ]; nativeBuildInputs = [ extra-cmake-modules ] ++ lib.optionals (logoFile != null) [ imagemagick netpbm perl ];
buildInputs = [ plymouth ]; buildInputs = [ plymouth ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./install-paths.patch
];
cmakeFlags = [] cmakeFlags = []
++ lib.optional (osName != null) "-DDISTRO_NAME=${osName}" ++ lib.optional (osName != null) "-DDISTRO_NAME=${osName}"
++ lib.optional (osVersion != null) "-DDISTRO_VERSION=${osVersion}" ++ lib.optional (osVersion != null) "-DDISTRO_VERSION=${osVersion}"

View File

@ -1 +0,0 @@
install-paths.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
epoxy,libICE, libSM, libinput, libxkbcommon, udev, wayland, xcb-util-cursor, epoxy,libICE, libSM, libinput, libxkbcommon, udev, wayland, xcb-util-cursor,

View File

@ -0,0 +1,39 @@
{ lib, mkDerivation, fetchFromGitHub
, kcoreaddons, kwindowsystem, plasma-framework, systemsettings }:
mkDerivation rec {
pname = "dynamic_workspaces";
version = "1.0.1";
src = fetchFromGitHub {
owner = "d86leader";
repo = pname;
rev = "v${version}";
sha256 = "1mnwh489i6l8z9s5a1zl7zybkw76pp9fdmmis41mym7r4wz4iznm";
};
buildInputs = [
kcoreaddons kwindowsystem plasma-framework systemsettings
];
dontBuild = true;
# 1. --global still installs to $HOME/.local/share so we use --packageroot
# 2. plasmapkg2 doesn't copy metadata.desktop into place, so we do that manually
installPhase = ''
runHook preInstall
plasmapkg2 --type kwinscript --install ${src} --packageroot $out/share/kwin/scripts
install -Dm644 ${src}/metadata.desktop $out/share/kservices5/dynamic_workspaces.desktop
runHook postInstall
'';
meta = with lib; {
description = "KWin script that automatically adds/removes virtual desktops";
license = licenses.bsd3;
maintainers = with maintainers; [ samuelgrf ];
inherit (src.meta) homepage;
inherit (kwindowsystem.meta) platforms;
};
}

View File

@ -26,7 +26,7 @@ mkDerivation rec {
plasmapkg2 --type kwinscript --install ${src}/res/ --packageroot $out/share/kwin/scripts plasmapkg2 --type kwinscript --install ${src}/res/ --packageroot $out/share/kwin/scripts
install -Dm644 ${src}/res/metadata.desktop $out/share/kservices5/krohnkite.desktop install -Dm644 ${src}/res/metadata.desktop $out/share/kservices5/krohnkite.desktop
runHook postInstalll runHook postInstall
''; '';
meta = with lib; { meta = with lib; {

View File

@ -31,7 +31,7 @@ mkDerivation rec {
plasmapkg2 --type kwinscript --install ${src} --packageroot $out/share/kwin/scripts plasmapkg2 --type kwinscript --install ${src} --packageroot $out/share/kwin/scripts
install -Dm644 ${src}/metadata.desktop $out/share/kservices5/kwin-script-tiling.desktop install -Dm644 ${src}/metadata.desktop $out/share/kservices5/kwin-script-tiling.desktop
runHook postInstalll runHook postInstall
''; '';
meta = with lib; { meta = with lib; {

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, propagate, mkDerivation, lib, propagate,
extra-cmake-modules, extra-cmake-modules,
kwayland, libXrandr, qtbase, qtx11extras kwayland, libXrandr, qtbase, qtx11extras
}: }:
@ -12,7 +12,9 @@ mkDerivation {
nativeBuildInputs = [ extra-cmake-modules ]; nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ kwayland libXrandr qtx11extras ]; buildInputs = [ kwayland libXrandr qtx11extras ];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./libkscreen-backends-path.patch
];
preConfigure = '' preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DNIXPKGS_LIBKSCREEN_BACKENDS=\"''${!outputBin}/$qtPluginPrefix/kf5/kscreen\"" NIX_CFLAGS_COMPILE+=" -DNIXPKGS_LIBKSCREEN_BACKENDS=\"''${!outputBin}/$qtPluginPrefix/kf5/kscreen\""
''; '';

View File

@ -1 +0,0 @@
libkscreen-backends-path.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
boost, fontconfig, ibus, libXcursor, libXft, libcanberra_kde, libpulseaudio, boost, fontconfig, ibus, libXcursor, libXft, libcanberra_kde, libpulseaudio,
@ -30,7 +30,10 @@ mkDerivation {
ksysguard kwallet kwin plasma-framework plasma-workspace qqc2-desktop-style ksysguard kwallet kwin plasma-framework plasma-workspace qqc2-desktop-style
]; ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./hwclock-path.patch
./tzdir.patch
];
postPatch = '' postPatch = ''
sed '1i#include <cmath>' -i kcms/touchpad/src/backends/x11/synapticstouchpad.cpp sed '1i#include <cmath>' -i kcms/touchpad/src/backends/x11/synapticstouchpad.cpp
''; '';

View File

@ -1,2 +0,0 @@
hwclock-path.patch
tzdir.patch

View File

@ -1,18 +1,24 @@
{ stdenv, fetchurl }: { stdenv, fetchurl }:
stdenv.mkDerivation { stdenv.mkDerivation rec {
name = "fpc-3.0.0-binary"; pname = "fpc-binary";
version = "3.2.0";
src = src =
if stdenv.hostPlatform.system == "i686-linux" then if stdenv.hostPlatform.system == "i686-linux" then
fetchurl { fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.i386-linux.tar"; url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.i386-linux.tar";
sha256 = "0h3f1dgs1zsx7vvk9kg67anjvgw5sslfbmjblif7ishbcp3k3g5k"; sha256 = "0y0510b2fbxbqz28967xx8b023k6q9fv5yclfrc1yc9mg8fyn411";
} }
else if stdenv.hostPlatform.system == "x86_64-linux" then else if stdenv.hostPlatform.system == "x86_64-linux" then
fetchurl { fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/3.0.0/fpc-3.0.0.x86_64-linux.tar"; url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}-x86_64-linux.tar";
sha256 = "1m2xx3nda45cb3zidbjgdr8kddd19zk0khvp7xxdlclszkqscln9"; sha256 = "0gfbwjvjqlx0562ayyl08khagslrws758al2yhbi4bz5rzk554ni";
}
else if stdenv.hostPlatform.system == "aarch64-linux" then
fetchurl {
url = "mirror://sourceforge/project/freepascal/Linux/${version}/fpc-${version}.aarch64-linux.tar";
sha256 = "1h481ngg3m8nlsg9mw7rr1bn2c4sj4wzqny9bxyq3xvcral12r71";
} }
else throw "Not supported on ${stdenv.hostPlatform.system}."; else throw "Not supported on ${stdenv.hostPlatform.system}.";

View File

@ -3,23 +3,26 @@
let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "3.0.4"; version = "3.2.0";
pname = "fpc"; pname = "fpc";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz"; url = "mirror://sourceforge/freepascal/fpcbuild-${version}.tar.gz";
sha256 = "0xjyhlhz846jbnp12y68c7nq4xmp4i65akfbrjyf3r62ybk18rgn"; sha256 = "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr";
}; };
buildInputs = [ startFPC gawk ]; buildInputs = [ startFPC gawk ];
glibc = stdenv.cc.libc.out; glibc = stdenv.cc.libc.out;
preConfigure = # Patch paths for linux systems. Other platforms will need their own patches.
if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then '' patches = [
sed -e "s@'/lib/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas ./mark-paths.patch # mark paths for later substitution in postPatch
sed -e "s@'/lib64/ld-linux[^']*'@'''@" -i fpcsrc/compiler/systems/t_linux.pas ];
sed -e "s@/lib64[^']*@${glibc}/lib@" -i fpcsrc/compiler/systems/t_linux.pas postPatch = ''
'' else ""; # substitute the markers set by the mark-paths patch
substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by dynlinker-prefix "${glibc}"
substituteInPlace fpcsrc/compiler/systems/t_linux.pas --subst-var-by syslibpath "${glibc}/lib"
'';
makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ]; makeFlags = [ "NOGDB=1" "FPC=${startFPC}/bin/fpc" ];

View File

@ -0,0 +1,109 @@
diff --git a/fpcsrc/compiler/systems/t_linux.pas b/fpcsrc/compiler/systems/t_linux.pas
index a7398fb9..8e46fec0 100644
--- a/fpcsrc/compiler/systems/t_linux.pas
+++ b/fpcsrc/compiler/systems/t_linux.pas
@@ -135,13 +135,13 @@ begin
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib64',true);
{ /lib64 should be the really first, so add it before everything else }
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib',true);
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64',true);
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true);
{$else}
{$ifdef powerpc64}
if target_info.abi<>abi_powerpc_elfv2 then
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib64;=/usr/X11R6/lib64',true)
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib64;=/usr/X11R6/lib64',true)
else
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib64;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true);
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=/@syslibpath@;=/usr/lib/powerpc64le-linux-gnu;=/usr/X11R6/powerpc64le-linux-gnu',true);
{$else powerpc64}
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/lib;=/usr/lib;=/usr/X11R6/lib',true);
{$endif powerpc64}
@@ -164,7 +164,7 @@ begin
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/i386-linux-gnu',true);
{$endif i386}
{$ifdef aarch64}
- LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/aarch64-linux-gnu',true);
+ LibrarySearchPath.AddLibraryPath(sysrootpath,'=@syslibpath@',true);
{$endif aarch64}
{$ifdef powerpc}
LibrarySearchPath.AddLibraryPath(sysrootpath,'=/usr/lib/powerpc-linux-gnu',true);
@@ -185,53 +185,53 @@ begin
end;
{$ifdef m68k}
- const defdynlinker='/lib/ld.so.1';
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
{$endif m68k}
{$ifdef i386}
- const defdynlinker='/lib/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
{$endif}
{$ifdef x86_64}
- const defdynlinker='/lib64/ld-linux-x86-64.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux-x86-64.so.2';
{$endif x86_64}
{$ifdef sparc}
- const defdynlinker='/lib/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
{$endif sparc}
{$ifdef powerpc}
- const defdynlinker='/lib/ld.so.1';
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
{$endif powerpc}
{$ifdef powerpc64}
- const defdynlinkerv1='/lib64/ld64.so.1';
- const defdynlinkerv2='/lib64/ld64.so.2';
+ const defdynlinkerv1='@dynlinker-prefix@/lib64/ld64.so.1';
+ const defdynlinkerv2='@dynlinker-prefix@/lib64/ld64.so.2';
var defdynlinker: string;
{$endif powerpc64}
{$ifdef arm}
{$ifdef FPC_ARMHF}
- const defdynlinker='/lib/ld-linux-armhf.so.3';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux-armhf.so.3';
{$else FPC_ARMHF}
{$ifdef FPC_ARMEL}
- const defdynlinker='/lib/ld-linux.so.3';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.3';
{$else FPC_ARMEL}
- const defdynlinker='/lib/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib/ld-linux.so.2';
{$endif FPC_ARMEL}
{$endif FPC_ARMHF}
{$endif arm}
{$ifdef aarch64}
-const defdynlinker='/lib/ld-linux-aarch64.so.1';
+const defdynlinker='@dynlinker-prefix@/lib/ld-linux-aarch64.so.1';
{$endif aarch64}
{$ifdef mips}
- const defdynlinker='/lib/ld.so.1';
+ const defdynlinker='@dynlinker-prefix@/lib/ld.so.1';
{$endif mips}
{$ifdef sparc64}
- const defdynlinker='/lib64/ld-linux.so.2';
+ const defdynlinker='@dynlinker-prefix@/lib64/ld-linux.so.2';
{$endif sparc64}
@@ -266,9 +266,9 @@ begin
libctype:=uclibc;
end
{$ifdef i386}
- else if FileExists(sysrootpath+'/lib/ld-linux.so.1',false) then
+ else if FileExists(sysrootpath+'@dynlinker-prefix@/lib/ld-linux.so.1',false) then
begin
- DynamicLinker:='/lib/ld-linux.so.1';
+ DynamicLinker:='@dynlinker-prefix@/lib/ld-linux.so.1';
libctype:=glibc2;
end
{$endif i386}

View File

@ -108,9 +108,9 @@ in {
major = "3"; major = "3";
minor = "9"; minor = "9";
patch = "0"; patch = "0";
suffix = "b5"; suffix = "rc1";
}; };
sha256 = "0r0m82srq4z44dahczd1cv6wgmxcpqbn5dyd8czcpk2pp9ydgqbc"; sha256 = "0w6wvyy9fbvfvrmhvmlb5gq18haagywk9hjkp1knjdarfczag9zv";
inherit (darwin) configd; inherit (darwin) configd;
inherit passthruFun; inherit passthruFun;
}; };

View File

@ -1,4 +1,4 @@
{ mkDerivation, lib, copyPathsToStore, fetchurl, qtbase, qtscript, cmake }: { mkDerivation, lib, fetchurl, qtbase, qtscript, cmake }:
mkDerivation rec { mkDerivation rec {
pname = "grantlee"; pname = "grantlee";
@ -14,7 +14,10 @@ mkDerivation rec {
buildInputs = [ qtbase qtscript ]; buildInputs = [ qtbase qtscript ];
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./grantlee-nix-profiles.patch
./grantlee-no-canonicalize-filepath.patch
];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
postFixup = postFixup =

View File

@ -1,2 +0,0 @@
grantlee-nix-profiles.patch
grantlee-no-canonicalize-filepath.patch

View File

@ -23,7 +23,7 @@ rec {
inherit gst-plugins-base gstreamer gst-plugins-bad; inherit gst-plugins-base gstreamer gst-plugins-bad;
}; };
gst-validate = callPackage ./validate { inherit gst-plugins-base; }; gst-validate = callPackage ./validate { inherit gstreamer gst-plugins-base; };
# note: gst-python is in ./python/default.nix - called under pythonPackages # note: gst-python is in ./python/default.nix - called under pythonPackages
} }

View File

@ -1,23 +0,0 @@
{ stdenv, fetchurl, pkgconfig, gst-plugins-base, gstreamer }:
stdenv.mkDerivation rec {
name = "gnonlin-0.10.17";
src = fetchurl {
urls = [
"https://gstreamer.freedesktop.org/src/gnonlin/${name}.tar.bz2"
"mirror://gentoo/distfiles/${name}.tar.bz2"
];
sha256 = "0dc9kvr6i7sh91cyhzlbx2bchwg84rfa4679ccppzjf0y65dv8p4";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ gst-plugins-base gstreamer ];
meta = {
homepage = "https://gstreamer.freedesktop.org/modules/gnonlin.html";
description = "Gstreamer Non-Linear Multimedia Editing Plugins";
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.unix;
};
}

View File

@ -1,36 +0,0 @@
{ fetchurl, stdenv, pkgconfig, glib, gstreamer, gst-plugins-base
, libdvdnav, libdvdread, orc }:
stdenv.mkDerivation rec {
name = "gst-plugins-bad-0.10.23";
src = fetchurl {
urls = [
"${meta.homepage}/src/gst-plugins-bad/${name}.tar.bz2"
"mirror://gentoo/distfiles/${name}.tar.bz2"
];
sha256 = "148lw51dm6pgw8vc6v0fpvm7p233wr11nspdzmvq7bjp2cd7vbhf";
};
postInstall = ''
# Fixes CVE-2016-9447
# Does not actually impact NSF playback
rm -v $out/lib/gstreamer-0.10/libgstnsf.so
'';
buildInputs =
[ pkgconfig glib gstreamer gst-plugins-base libdvdnav libdvdread orc ];
enableParallelBuilding = true;
meta = {
homepage = "https://gstreamer.freedesktop.org";
description = "Bad (potentially low quality) plug-ins for GStreamer";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.lgpl2Plus;
};
}

View File

@ -1,62 +0,0 @@
{ fetchurl, fetchpatch, stdenv, pkgconfig, gstreamer, xorg, alsaLib, cdparanoia
, libogg, libtheora, libvorbis, freetype, pango, liboil, glib, cairo, orc
, libintl
, ApplicationServices
, # Whether to build no plugins that have external dependencies
# (except the ALSA plugin).
minimalDeps ? false
}:
stdenv.mkDerivation rec {
name = "gst-plugins-base-0.10.36";
src = fetchurl {
urls = [
"${meta.homepage}/src/gst-plugins-base/${name}.tar.xz"
"mirror://gentoo/distfiles/${name}.tar.xz"
];
sha256 = "0jp6hjlra98cnkal4n6bdmr577q8mcyp3c08s3a02c4hjhw5rr0z";
};
patches = [
./gcc-4.9.patch
(fetchpatch {
url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/f672277509705c4034bc92a141eefee4524d15aa.patch";
name = "CVE-2019-9928.patch";
sha256 = "1dlamsmyr7chrb6vqqmwikqvvqcx5l7k72p98448qm6k59ndnimc";
})
];
postPatch = ''
sed -i 's@/bin/echo@echo@g' configure
sed -i -e 's/^ /\t/' docs/{libs,plugins}/Makefile.in
'';
outputs = [ "out" "dev" ];
# TODO : v4l, libvisual
buildInputs =
[ pkgconfig glib cairo orc libintl ]
# can't build alsaLib on darwin
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib
++ stdenv.lib.optionals (!minimalDeps)
[ xorg.xlibsWrapper xorg.libXv libogg libtheora libvorbis freetype pango
liboil ]
# can't build cdparanoia on darwin
++ stdenv.lib.optional (!minimalDeps && !stdenv.isDarwin) cdparanoia
++ stdenv.lib.optional stdenv.isDarwin ApplicationServices;
propagatedBuildInputs = [ gstreamer ];
postInstall = "rm -rf $out/share/gtk-doc";
meta = with stdenv.lib; {
homepage = "https://gstreamer.freedesktop.org";
description = "Base plug-ins for GStreamer";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.unix;
# https://github.com/NixOS/nixpkgs/pull/91090#issuecomment-653753497
broken = true;
};
}

View File

@ -1,38 +0,0 @@
https://bugzilla.gnome.org/show_bug.cgi?id=670690
From 9bd5a7ae5435469c3557a3d70e762791cb3dc5c7 Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@gnome.org>
Date: Mon, 20 Jan 2014 15:44:09 +0100
Subject: [PATCH] audioresample: fix build on BSD
On i386, EMMINTRIN is defined but not usable without sse so check for
__SSE__ and __SSE2__ as well.
https://bugzilla.gnome.org/show_bug.cgi?id=670690
---
gst/audioresample/resample.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gst/audioresample/resample.c b/gst/audioresample/resample.c
index 98d006c..481fa01 100644
--- a/gst/audioresample/resample.c
+++ b/gst/audioresample/resample.c
@@ -77,13 +77,13 @@
#define EXPORT G_GNUC_INTERNAL
#ifdef _USE_SSE
-#ifndef HAVE_XMMINTRIN_H
+#if !defined(__SSE__) || !defined(HAVE_XMMINTRIN_H)
#undef _USE_SSE
#endif
#endif
#ifdef _USE_SSE2
-#ifndef HAVE_EMMINTRIN_H
+#if !defined(__SSE2__) || !defined(HAVE_XMMINTRIN_H)
#undef _USE_SSE2
#endif
#endif
--
1.8.5.3

View File

@ -1,52 +0,0 @@
{ fetchurl, stdenv, lib, pkgconfig, gst-plugins-base, aalib, cairo
, flac, libjpeg, speex, libpng, libdv, libcaca, libvpx
, taglib, libpulseaudio, gdk-pixbuf, orc
, glib, gstreamer, bzip2, libsoup, libshout, ncurses, libintl
, # Whether to build no plugins that have external dependencies
# (except the PulseAudio plugin).
minimalDeps ? false
}:
stdenv.mkDerivation rec {
name = "gst-plugins-good-0.10.31";
src = fetchurl {
urls = [
"${meta.homepage}/src/gst-plugins-good/${name}.tar.bz2"
"mirror://gentoo/distfiles/${name}.tar.bz2"
];
sha256 = "1ijswgcrdp243mfsyza31fpzq6plz40p4b83vkr2x4x7807889vy";
};
patches = [ ./v4l.patch ./linux-headers-3.9.patch ];
configureFlags = [ "--enable-experimental" "--disable-oss" ];
buildInputs =
[ pkgconfig glib gstreamer gst-plugins-base libintl ]
++ lib.optional stdenv.isLinux libpulseaudio
++ lib.optionals (!minimalDeps)
[ aalib libcaca cairo libdv flac libjpeg libpng speex
taglib bzip2 libvpx gdk-pixbuf orc libsoup libshout ];
enableParallelBuilding = true;
postInstall = lib.optionalString (!minimalDeps) ''
substituteInPlace $out/lib/gstreamer-0.10/libgstaasink.la \
--replace "${ncurses.dev}/lib" "${ncurses.out}/lib"
'';
# fails 1 out of 65 tests with "Could not read TLS certificate from '../../tests/files/test-cert.pem': TLS support is not available"
doCheck = false;
meta = {
homepage = "https://gstreamer.freedesktop.org";
description = "`Good' plug-ins for GStreamer";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.unix;
license = stdenv.lib.licenses.lgpl2Plus;
};
}

View File

@ -1,27 +0,0 @@
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-plugins/gst-plugins-v4l2/files/gst-plugins-v4l2-0.10.31-linux-headers-3.9.patch
From 8e633d2059cb835448021cf79becb487aff10975 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 18 Mar 2013 14:59:35 +0000
Subject: v4l2: fix compilation against newer kernel headers as on FC19
---
diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c
index 07d390a..4c10f4f 100644
--- a/sys/v4l2/v4l2_calls.c
+++ b/sys/v4l2/v4l2_calls.c
@@ -291,8 +291,12 @@ gst_v4l2_fill_lists (GstV4l2Object * v4l2object)
break;
case V4L2_CID_HFLIP:
case V4L2_CID_VFLIP:
+#ifndef V4L2_CID_PAN_RESET
case V4L2_CID_HCENTER:
+#endif
+#ifndef V4L2_CID_TILT_RESET
case V4L2_CID_VCENTER:
+#endif
#ifdef V4L2_CID_PAN_RESET
case V4L2_CID_PAN_RESET:
#endif
--
cgit v0.9.0.2-2-gbebe

View File

@ -1,11 +0,0 @@
diff -ru -x '*~' gst-plugins-good-0.10.31-orig/sys/v4l2/gstv4l2bufferpool.c gst-plugins-good-0.10.31/sys/v4l2/gstv4l2bufferpool.c
--- gst-plugins-good-0.10.31-orig/sys/v4l2/gstv4l2bufferpool.c 2011-12-30 14:59:13.000000000 +0100
+++ gst-plugins-good-0.10.31/sys/v4l2/gstv4l2bufferpool.c 2013-01-28 17:41:25.549523708 +0100
@@ -181,7 +181,6 @@
GST_LOG_OBJECT (pool->v4l2elem, " MMAP offset: %u",
ret->vbuffer.m.offset);
GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
- GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,

View File

@ -1,30 +0,0 @@
{ fetchurl, stdenv, pkgconfig, glib, gstreamer, gst-plugins-base
, libmad, libdvdread, a52dec, x264, orc, lame, libintl }:
stdenv.mkDerivation rec {
name = "gst-plugins-ugly-0.10.19";
src = fetchurl {
urls = [
"${meta.homepage}/src/gst-plugins-ugly/${name}.tar.bz2"
"mirror://gentoo/distfiles/${name}.tar.bz2"
];
sha256 = "1w4d5iz9ffvh43l261zdp997i6s2iwd61lflf755s3sw4xch1a8w";
};
buildInputs =
[ pkgconfig glib gstreamer gst-plugins-base libmad libdvdread a52dec x264 orc lame libintl ];
enableParallelBuilding = true;
meta = {
homepage = "https://gstreamer.freedesktop.org";
description = "Ugly (potentially patent-encumbered) plug-ins for GStreamer";
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.unix;
license = stdenv.lib.licenses.lgpl2Plus;
};
}

View File

@ -1,37 +0,0 @@
{ fetchurl, stdenv, pkgconfig, python2Packages, gstreamer, gst-plugins-base
}:
let
inherit (python2Packages) python pygobject2;
in stdenv.mkDerivation rec {
name = "gst-python-0.10.22";
src = fetchurl {
urls = [
"${meta.homepage}/src/gst-python/${name}.tar.bz2"
"mirror://gentoo/distfiles/${name}.tar.bz2"
];
sha256 = "0y1i4n5m1diljqr9dsq12anwazrhbs70jziich47gkdwllcza9lg";
};
hardeningDisable = [ "bindnow" ];
# Need to disable the testFake test case due to bug in pygobject.
# See https://bugzilla.gnome.org/show_bug.cgi?id=692479
patches = [ ./disable-testFake.patch ];
buildInputs =
[ pkgconfig gst-plugins-base pygobject2 ]
;
propagatedBuildInputs = [ gstreamer python ];
meta = {
homepage = "https://gstreamer.freedesktop.org";
description = "Python bindings for GStreamer";
license = stdenv.lib.licenses.lgpl2Plus;
platforms = stdenv.lib.platforms.unix;
};
}

View File

@ -1,56 +0,0 @@
diff -Nurp gst-python-0.10.22.orig/testsuite/test_bin.py gst-python-0.10.22/testsuite/test_bin.py
--- gst-python-0.10.22.orig/testsuite/test_bin.py 2014-10-29 18:58:00.921827721 +0100
+++ gst-python-0.10.22/testsuite/test_bin.py 2014-10-29 19:00:32.019353092 +0100
@@ -131,52 +131,6 @@ class BinAddRemove(TestCase):
self.assertRaises(gst.AddError, self.bin.add, src, sink)
self.bin.remove(src, sink)
self.assertRaises(gst.RemoveError, self.bin.remove, src, sink)
-
-class Preroll(TestCase):
- def setUp(self):
- TestCase.setUp(self)
- self.bin = gst.Bin('bin')
-
- def tearDown(self):
- # FIXME: wait for state change thread to settle down
- while self.bin.__gstrefcount__ > 1:
- time.sleep(0.1)
- self.assertEquals(self.bin.__gstrefcount__, 1)
- del self.bin
- TestCase.tearDown(self)
-
- def testFake(self):
- src = gst.element_factory_make('fakesrc')
- sink = gst.element_factory_make('fakesink')
- self.bin.add(src)
-
- # bin will go to paused, src pad task will start and error out
- self.bin.set_state(gst.STATE_PAUSED)
- ret = self.bin.get_state()
- self.assertEquals(ret[0], gst.STATE_CHANGE_SUCCESS)
- self.assertEquals(ret[1], gst.STATE_PAUSED)
- self.assertEquals(ret[2], gst.STATE_VOID_PENDING)
-
- # adding the sink will cause the bin to go in preroll mode
- gst.debug('adding sink and setting to PAUSED, should cause preroll')
- self.bin.add(sink)
- sink.set_state(gst.STATE_PAUSED)
- ret = self.bin.get_state(timeout=0)
- self.assertEquals(ret[0], gst.STATE_CHANGE_ASYNC)
- self.assertEquals(ret[1], gst.STATE_PAUSED)
- self.assertEquals(ret[2], gst.STATE_PAUSED)
-
- # to actually complete preroll, we need to link and re-enable fakesrc
- src.set_state(gst.STATE_READY)
- src.link(sink)
- src.set_state(gst.STATE_PAUSED)
- ret = self.bin.get_state()
- self.assertEquals(ret[0], gst.STATE_CHANGE_SUCCESS)
- self.assertEquals(ret[1], gst.STATE_PAUSED)
- self.assertEquals(ret[2], gst.STATE_VOID_PENDING)
-
- self.bin.set_state(gst.STATE_NULL)
- self.bin.get_state()
class ConstructorTest(TestCase):
def testGood(self):

View File

@ -1,14 +0,0 @@
diff --git a/gst/gstdatetime.c b/gst/gstdatetime.c
index 60f709f..cdc7e75 100644
--- a/gst/gstdatetime.c
+++ b/gst/gstdatetime.c
@@ -21,8 +21,8 @@
#include "config.h"
#endif
-#include "glib-compat-private.h"
#include "gst_private.h"
+#include "glib-compat-private.h"
#include "gstdatetime.h"
#include <glib.h>
#include <math.h>

View File

@ -1,89 +0,0 @@
{ fetchurl, fetchpatch, stdenv, autoreconfHook
, perl, bison, flex, pkgconfig, glib, libxml2, libintl, libunwind
}:
stdenv.mkDerivation rec {
name = "gstreamer-0.10.36";
src = fetchurl {
urls =
[ "${meta.homepage}/src/gstreamer/${name}.tar.xz"
"mirror://gentoo/distfiles/${name}.tar.xz"
];
sha256 = "1nkid1n2l3rrlmq5qrf5yy06grrkwjh3yxl5g0w58w0pih8allci";
};
outputs = [ "out" "dev" ];
nativeBuildInputs = [ autoreconfHook flex perl pkgconfig libintl bison glib ];
buildInputs = stdenv.lib.optional stdenv.isDarwin libunwind;
propagatedBuildInputs = [ glib libxml2 ];
patches = [
(fetchpatch {
url = "https://github.com/flathub/com.xnview.XnRetro/raw/fec03bbe240f45aa10d7d4eea9d6f066d9b6ac9c/gstreamer-0.10.36-bison3.patch";
sha256 = "05aarg3yzl5jx3z5838ixv392g0r3kbsi2vfqniaxmidhnfzij2y";
})
(fetchpatch {
url = "https://github.com/GStreamer/common/commit/03a0e5736761a72d4ed880e8c485bbf9e4a8ea47.patch";
sha256 = "0rin3x01yy78ky3smmhbwlph18hhym18q4x9w6ddiqajg5lk4xhm";
extraPrefix = "common/";
stripLen = 1;
})
(fetchpatch {
url = "https://github.com/GStreamer/common/commit/8aadeaaa8a948d7ce62008789ab03e9aa514c2b9.patch";
sha256 = "0n2mqvq2al7jr2hflhz4l781i3jya5a9i725jvy508ambpgycz3x";
extraPrefix = "common/";
stripLen = 1;
})
(fetchpatch {
url = "https://github.com/GStreamer/common/commit/7bb2bcecda471a0d514a964365a78150f3ee5747.patch";
sha256 = "0famdj70m7wjvr1dpy7iywhrkqxmrshxz0rizz1bixgp42dvkhbq";
extraPrefix = "common/";
stripLen = 1;
})
] ++
# See https://trac.macports.org/ticket/40783 for explanation of patch
stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
postPatch = ''
sed -i -e 's/^ /\t/' docs/gst/Makefile.in docs/libs/Makefile.in docs/plugins/Makefile.in
'';
configureFlags = [
"--disable-examples"
"--localstatedir=/var"
"--disable-gtk-doc"
"--disable-docbook"
];
doCheck = false; # fails. 2 tests crash
postInstall = ''
# Hm, apparently --disable-gtk-doc is ignored...
rm -rf $out/share/gtk-doc
'';
setupHook = ./setup-hook.sh;
meta = {
homepage = "https://gstreamer.freedesktop.org";
description = "Library for constructing graphs of media-handling components";
longDescription = ''
GStreamer is a library for constructing graphs of media-handling
components. The applications it supports range from simple
Ogg/Vorbis playback, audio/video streaming to complex audio
(mixing) and video (non-linear editing) processing.
Applications can take advantage of advances in codec and filter
technology transparently. Developers can add new codecs and
filters by writing a simple plugin with a clean, generic
interface.
'';
license = stdenv.lib.licenses.lgpl2Plus;
platforms = stdenv.lib.platforms.unix;
};
}

View File

@ -1,8 +0,0 @@
addGstreamerLibPath () {
if test -d "$1/lib/gstreamer-0.10"
then
export GST_PLUGIN_SYSTEM_PATH="${GST_PLUGIN_SYSTEM_PATH-}${GST_PLUGIN_SYSTEM_PATH:+:}$1/lib/gstreamer-0.10"
fi
}
addEnvHooks "$hostOffset" addGstreamerLibPath

View File

@ -1,31 +0,0 @@
{ stdenv, fetchurl, glibmm, gstreamer, gst-plugins-base, libsigcxx, libxmlxx, pkgconfig }:
let
ver_maj = "0.10";
ver_min = "11";
in
stdenv.mkDerivation {
name = "gstreamermm-${ver_maj}.${ver_min}";
src = fetchurl {
url = "mirror://gnome/sources/gstreamermm/${ver_maj}/gstreamermm-${ver_maj}.${ver_min}.tar.xz";
sha256 = "12b5f377363594a69cb79f2f5cd0a8b1813ca6553680c3216e6354cfd682ebc6";
};
doCheck = false; # Tests require pulseaudio in /homeless-shelter
propagatedBuildInputs = [
glibmm gstreamer gst-plugins-base libsigcxx libxmlxx
];
nativeBuildInputs = [ pkgconfig ];
meta = with stdenv.lib; {
description = "C++ bindings for the GStreamer streaming multimedia library";
homepage = "https://www.gtkmm.org/";
license = licenses.lgpl2Plus;
maintainers = with maintainers; [ plcplc ];
platforms = platforms.unix;
};
}

View File

@ -20,6 +20,15 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
patches = [
# To use split outputs, we need this so double prefix won't be used in the
# pkg-config files. Hopefully, this won't be needed on the next release,
# _if_
# https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/merge_requests/1
# will be merged. For the current release, this merge request won't apply.
./fix_pkgconfig_includedir.patch
];
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja

View File

@ -0,0 +1,15 @@
diff --git i/pkgconfig/meson.build w/pkgconfig/meson.build
index 8ed8299..594cbfe 100644
--- i/pkgconfig/meson.build
+++ w/pkgconfig/meson.build
@@ -2,8 +2,8 @@ pkgconf = configuration_data()
pkgconf.set('prefix', get_option('prefix'))
pkgconf.set('exec_prefix', '${prefix}')
-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
+pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
+pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
pkgconf.set('GST_API_VERSION', api_version)
pkgconf.set('VERSION', gst_version)

View File

@ -1,9 +1,11 @@
{ mkDerivation, lib, copyPathsToStore, cmake, pkgconfig }: { mkDerivation, lib, cmake, pkgconfig }:
mkDerivation { mkDerivation {
name = "extra-cmake-modules"; name = "extra-cmake-modules";
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./nix-lib-path.patch
];
outputs = [ "out" ]; # this package has no runtime components outputs = [ "out" ]; # this package has no runtime components

View File

@ -1 +0,0 @@
nix-lib-path.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, propagate, mkDerivation, lib, propagate,
extra-cmake-modules, kcoreaddons, polkit-qt, qttools extra-cmake-modules, kcoreaddons, polkit-qt, qttools
}: }:
@ -9,7 +9,9 @@ mkDerivation {
nativeBuildInputs = [ extra-cmake-modules ]; nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ polkit-qt qttools ]; buildInputs = [ polkit-qt qttools ];
propagatedBuildInputs = [ kcoreaddons ]; propagatedBuildInputs = [ kcoreaddons ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./cmake-install-paths.patch
];
# library stores reference to plugin path, # library stores reference to plugin path,
# separating $out from $bin would create a reference cycle # separating $out from $bin would create a reference cycle
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];

View File

@ -1 +0,0 @@
cmake-install-paths.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, extra-cmake-modules,
kconfigwidgets, kcoreaddons, kdeclarative, ki18n, kiconthemes, kitemviews, kconfigwidgets, kcoreaddons, kdeclarative, ki18n, kiconthemes, kitemviews,
kpackage, kservice, kxmlgui, qtdeclarative, kpackage, kservice, kxmlgui, qtdeclarative,

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
docbook_xml_dtd_45, extra-cmake-modules, kdoctools, docbook_xml_dtd_45, extra-cmake-modules, kdoctools,
kauth, karchive, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kcrash, kauth, karchive, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kcrash,
kdbusaddons, kded, kdesignerplugin, kemoticons, kglobalaccel, kguiaddons, kdbusaddons, kded, kdesignerplugin, kemoticons, kglobalaccel, kguiaddons,
@ -11,7 +11,9 @@
mkDerivation { mkDerivation {
name = "kdelibs4support"; name = "kdelibs4support";
meta = { maintainers = [ lib.maintainers.ttuegel ]; }; meta = { maintainers = [ lib.maintainers.ttuegel ]; };
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./nix-kde-include-dir.patch
];
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
nativeBuildInputs = [ extra-cmake-modules qttools ]; nativeBuildInputs = [ extra-cmake-modules qttools ];
propagatedNativeBuildInputs = [ kdoctools ]; propagatedNativeBuildInputs = [ kdoctools ];

View File

@ -1 +0,0 @@
nix-kde-include-dir.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, extra-cmake-modules,
attr, ebook_tools, exiv2, ffmpeg_3, karchive, kcoreaddons, ki18n, poppler, qtbase, qtmultimedia, taglib attr, ebook_tools, exiv2, ffmpeg_3, karchive, kcoreaddons, ki18n, poppler, qtbase, qtmultimedia, taglib
}: }:
@ -12,5 +12,7 @@ mkDerivation {
attr ebook_tools exiv2 ffmpeg_3 karchive kcoreaddons ki18n poppler qtbase qtmultimedia attr ebook_tools exiv2 ffmpeg_3 karchive kcoreaddons ki18n poppler qtbase qtmultimedia
taglib taglib
]; ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./cmake-install-paths.patch
];
} }

View File

@ -1 +0,0 @@
cmake-install-paths.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, extra-cmake-modules,
breeze-icons, karchive, kcoreaddons, kconfigwidgets, ki18n, kitemviews, breeze-icons, karchive, kcoreaddons, kconfigwidgets, ki18n, kitemviews,
qtbase, qtsvg, qttools, qtbase, qtsvg, qttools,
@ -8,7 +8,9 @@
mkDerivation { mkDerivation {
name = "kiconthemes"; name = "kiconthemes";
meta = { maintainers = [ lib.maintainers.ttuegel ]; }; meta = { maintainers = [ lib.maintainers.ttuegel ]; };
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./default-theme-breeze.patch
];
nativeBuildInputs = [ extra-cmake-modules ]; nativeBuildInputs = [ extra-cmake-modules ];
buildInputs = [ buildInputs = [
breeze-icons karchive kcoreaddons kconfigwidgets ki18n kitemviews breeze-icons karchive kcoreaddons kconfigwidgets ki18n kitemviews

View File

@ -1 +0,0 @@
default-theme-breeze.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, writeScript, mkDerivation, lib, writeScript,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
kconfig, kcrash, ki18n, kio, kparts, kservice, kwindowsystem, plasma-framework kconfig, kcrash, ki18n, kio, kparts, kservice, kwindowsystem, plasma-framework
}: }:

View File

@ -1,3 +0,0 @@
kinit-libpath.patch
start_kdeinit-path.patch
kdeinit-extra_libs.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, kdoctools, qttools, extra-cmake-modules, kdoctools, qttools,
karchive, kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons, karchive, kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons,
kdbusaddons, ki18n, kiconthemes, kitemviews, kjobwidgets, knotifications, kdbusaddons, ki18n, kiconthemes, kitemviews, kjobwidgets, knotifications,
@ -21,5 +21,8 @@ mkDerivation {
kxmlgui qtbase qttools solid kxmlgui qtbase qttools solid
]; ];
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
patches = (copyPathsToStore (lib.readPathsFromFile ./. ./series)); patches = [
./samba-search-path.patch
./kio-debug-module-loader.patch
];
} }

View File

@ -1,2 +0,0 @@
samba-search-path.patch
kio-debug-module-loader.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
extra-cmake-modules, kdoctools, extra-cmake-modules, kdoctools,
karchive, kconfig, kcoreaddons, ki18n, qtbase, karchive, kconfig, kcoreaddons, ki18n, qtbase,
}: }:
@ -9,5 +9,8 @@ mkDerivation {
meta = { maintainers = [ lib.maintainers.ttuegel ]; }; meta = { maintainers = [ lib.maintainers.ttuegel ]; };
nativeBuildInputs = [ extra-cmake-modules kdoctools ]; nativeBuildInputs = [ extra-cmake-modules kdoctools ];
buildInputs = [ karchive kconfig kcoreaddons ki18n qtbase ]; buildInputs = [ karchive kconfig kcoreaddons ki18n qtbase ];
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./allow-external-paths.patch
./qdiriterator-follow-symlinks.patch
];
} }

View File

@ -1,2 +0,0 @@
allow-external-paths.patch
qdiriterator-follow-symlinks.patch

View File

@ -1,5 +1,5 @@
{ {
mkDerivation, lib, copyPathsToStore, mkDerivation, lib,
bison, extra-cmake-modules, flex, bison, extra-cmake-modules, flex,
kconfig, kcoreaddons, kcrash, kdbusaddons, kdoctools, ki18n, kwindowsystem, kconfig, kcoreaddons, kcrash, kdbusaddons, kdoctools, ki18n, kwindowsystem,
qtbase, shared-mime-info, qtbase, shared-mime-info,
@ -15,5 +15,8 @@ mkDerivation {
]; ];
propagatedBuildInputs = [ kconfig kcoreaddons ]; propagatedBuildInputs = [ kconfig kcoreaddons ];
propagatedUserEnvPkgs = [ shared-mime-info ]; # for kbuildsycoca5 propagatedUserEnvPkgs = [ shared-mime-info ]; # for kbuildsycoca5
patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); patches = [
./qdiriterator-follow-symlinks.patch
./no-canonicalize-path.patch
];
} }

View File

@ -1,2 +0,0 @@
qdiriterator-follow-symlinks.patch
no-canonicalize-path.patch

Some files were not shown because too many files have changed in this diff Show More