commit
c02da5611d
@ -0,0 +1,41 @@ |
||||
Modified from <https://github.com/wangqr/Aegisub/commit/f8dca9f6386299ec2f90158e2d923a8fb30e3466>
|
||||
to patch cleanly to v3.3.2. Necessary for building without git.
|
||||
Upstream and will be in next release.
|
||||
|
||||
diff --git a/build/version.sh b/build/version.sh
|
||||
index 8cea0a3f3..d505341e4 100755
|
||||
--- a/build/version.sh
|
||||
+++ b/build/version.sh
|
||||
@@ -10,13 +10,13 @@ if ! test -d "${srcdir}/.git"; then
|
||||
done < "${version_h_path}"
|
||||
if test x$BUILD_GIT_VERSION_NUMBER != x -a x$BUILD_GIT_VERSION_STRING != x; then
|
||||
export VERSION_SOURCE="from cached git_version.h"
|
||||
- return 0
|
||||
+ exit 0
|
||||
else
|
||||
echo "invalid git_version.h"
|
||||
exit 2
|
||||
fi
|
||||
- else
|
||||
- echo "git repo not found and no cached git_version.h"
|
||||
+ elif [ -z "$FORCE_GIT_VERSION" ]; then
|
||||
+ echo "git repo not found and no cached git_version.h - use FORCE_GIT_VERSION to override"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
@@ -25,13 +25,13 @@ last_svn_revision=6962
|
||||
last_svn_hash="16cd907fe7482cb54a7374cd28b8501f138116be"
|
||||
|
||||
git_revision=$(expr $last_svn_revision + $(git log --pretty=oneline $last_svn_hash..HEAD 2>/dev/null | wc -l))
|
||||
-git_version_str=$(git describe --exact-match 2> /dev/null)
|
||||
+git_version_str=${FORCE_GIT_VERSION:-$(git describe --exact-match 2> /dev/null)}
|
||||
installer_version='0.0.0'
|
||||
resource_version='0, 0, 0'
|
||||
if test x$git_version_str != x; then
|
||||
git_version_str="${git_version_str##v}"
|
||||
tagged_release=1
|
||||
- if [ $(echo $git_version_str | grep '\d\.\d\.\d') ]; then
|
||||
+ if [ $(echo $git_version_str | grep '[0-9].[0-9].[0-9]') ]; then
|
||||
installer_version=$git_version_str
|
||||
resource_version=$(echo $git_version_str | sed 's/\./, /g')
|
||||
fi
|
@ -1,105 +0,0 @@ |
||||
commit 89c4e8d34ab77c3322f097b91fd9de22cbea7a37
|
||||
Author: Thomas Goyne <plorkyeran@aegisub.org>
|
||||
Date: Wed Nov 21 16:41:05 2018 -0800
|
||||
|
||||
Update ffmpeg and ffms2
|
||||
|
||||
diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp
|
||||
index 8bd68fbbf..f4ed6a2f2 100644
|
||||
--- a/src/video_provider_ffmpegsource.cpp
|
||||
+++ b/src/video_provider_ffmpegsource.cpp
|
||||
@@ -44,6 +44,23 @@
|
||||
#include <libaegisub/make_unique.h>
|
||||
|
||||
namespace {
|
||||
+typedef enum AGI_ColorSpaces {
|
||||
+ AGI_CS_RGB = 0,
|
||||
+ AGI_CS_BT709 = 1,
|
||||
+ AGI_CS_UNSPECIFIED = 2,
|
||||
+ AGI_CS_FCC = 4,
|
||||
+ AGI_CS_BT470BG = 5,
|
||||
+ AGI_CS_SMPTE170M = 6,
|
||||
+ AGI_CS_SMPTE240M = 7,
|
||||
+ AGI_CS_YCOCG = 8,
|
||||
+ AGI_CS_BT2020_NCL = 9,
|
||||
+ AGI_CS_BT2020_CL = 10,
|
||||
+ AGI_CS_SMPTE2085 = 11,
|
||||
+ AGI_CS_CHROMATICITY_DERIVED_NCL = 12,
|
||||
+ AGI_CS_CHROMATICITY_DERIVED_CL = 13,
|
||||
+ AGI_CS_ICTCP = 14
|
||||
+} AGI_ColorSpaces;
|
||||
+
|
||||
/// @class FFmpegSourceVideoProvider
|
||||
/// @brief Implements video loading through the FFMS library.
|
||||
class FFmpegSourceVideoProvider final : public VideoProvider, FFmpegSourceProvider {
|
||||
@@ -78,7 +95,7 @@ public:
|
||||
if (matrix == RealColorSpace)
|
||||
FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), nullptr);
|
||||
else if (matrix == "TV.601")
|
||||
- FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
|
||||
+ FFMS_SetInputFormatV(VideoSource, AGI_CS_BT470BG, CR, FFMS_GetPixFmt(""), nullptr);
|
||||
else
|
||||
return;
|
||||
ColorSpace = matrix;
|
||||
@@ -103,16 +120,16 @@ std::string colormatrix_description(int cs, int cr) {
|
||||
std::string str = cr == FFMS_CR_JPEG ? "PC" : "TV";
|
||||
|
||||
switch (cs) {
|
||||
- case FFMS_CS_RGB:
|
||||
+ case AGI_CS_RGB:
|
||||
return "None";
|
||||
- case FFMS_CS_BT709:
|
||||
+ case AGI_CS_BT709:
|
||||
return str + ".709";
|
||||
- case FFMS_CS_FCC:
|
||||
+ case AGI_CS_FCC:
|
||||
return str + ".FCC";
|
||||
- case FFMS_CS_BT470BG:
|
||||
- case FFMS_CS_SMPTE170M:
|
||||
+ case AGI_CS_BT470BG:
|
||||
+ case AGI_CS_SMPTE170M:
|
||||
return str + ".601";
|
||||
- case FFMS_CS_SMPTE240M:
|
||||
+ case AGI_CS_SMPTE240M:
|
||||
return str + ".240M";
|
||||
default:
|
||||
throw VideoOpenError("Unknown video color space");
|
||||
@@ -206,8 +223,10 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
|
||||
|
||||
// set thread count
|
||||
int Threads = OPT_GET("Provider/Video/FFmpegSource/Decoding Threads")->GetInt();
|
||||
+#if FFMS_VERSION < ((2 << 24) | (30 << 16) | (0 << 8) | 0)
|
||||
if (FFMS_GetVersion() < ((2 << 24) | (17 << 16) | (2 << 8) | 1) && FFMS_GetSourceType(Index) == FFMS_SOURCE_LAVF)
|
||||
Threads = 1;
|
||||
+#endif
|
||||
|
||||
// set seekmode
|
||||
// TODO: give this its own option?
|
||||
@@ -235,18 +254,22 @@ void FFmpegSourceVideoProvider::LoadVideo(agi::fs::path const& filename, std::st
|
||||
else
|
||||
DAR = double(Width) / Height;
|
||||
|
||||
- CS = TempFrame->ColorSpace;
|
||||
+ int VideoCS = CS = TempFrame->ColorSpace;
|
||||
CR = TempFrame->ColorRange;
|
||||
|
||||
- if (CS == FFMS_CS_UNSPECIFIED)
|
||||
- CS = Width > 1024 || Height >= 600 ? FFMS_CS_BT709 : FFMS_CS_BT470BG;
|
||||
+ if (CS == AGI_CS_UNSPECIFIED)
|
||||
+ CS = Width > 1024 || Height >= 600 ? AGI_CS_BT709 : AGI_CS_BT470BG;
|
||||
RealColorSpace = ColorSpace = colormatrix_description(CS, CR);
|
||||
|
||||
#if FFMS_VERSION >= ((2 << 24) | (17 << 16) | (1 << 8) | 0)
|
||||
- if (CS != FFMS_CS_RGB && CS != FFMS_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
|
||||
- if (FFMS_SetInputFormatV(VideoSource, FFMS_CS_BT470BG, CR, FFMS_GetPixFmt(""), &ErrInfo))
|
||||
+ if (CS != AGI_CS_RGB && CS != AGI_CS_BT470BG && ColorSpace != colormatrix && (colormatrix == "TV.601" || OPT_GET("Video/Force BT.601")->GetBool())) {
|
||||
+ CS = AGI_CS_BT470BG;
|
||||
+ ColorSpace = colormatrix_description(AGI_CS_BT470BG, CR);
|
||||
+ }
|
||||
+
|
||||
+ if (CS != VideoCS) {
|
||||
+ if (FFMS_SetInputFormatV(VideoSource, CS, CR, FFMS_GetPixFmt(""), &ErrInfo))
|
||||
throw VideoOpenError(std::string("Failed to set input format: ") + ErrInfo.Buffer);
|
||||
- ColorSpace = colormatrix_description(FFMS_CS_BT470BG, CR);
|
||||
}
|
||||
#endif
|
@ -0,0 +1,53 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchPypi |
||||
, einops |
||||
, emoji |
||||
, flax |
||||
, ftfy |
||||
, jax |
||||
, jaxlib |
||||
, pillow |
||||
, transformers |
||||
, unidecode |
||||
, wandb |
||||
}: |
||||
|
||||
buildPythonPackage rec { |
||||
pname = "dalle-mini"; |
||||
version = "0.1.0"; |
||||
|
||||
src = fetchPypi { |
||||
inherit pname version; |
||||
sha256 = "sha256-Sbos44uWGnJLYMx/xy0wkyAJHlDhVIeOS7rnYt2W53w="; |
||||
}; |
||||
|
||||
format = "setuptools"; |
||||
|
||||
buildInputs = [ |
||||
jaxlib |
||||
]; |
||||
|
||||
propagatedBuildInputs = [ |
||||
einops |
||||
emoji |
||||
flax |
||||
ftfy |
||||
jax |
||||
pillow |
||||
transformers |
||||
unidecode |
||||
wandb |
||||
]; |
||||
|
||||
doCheck = false; # no upstream tests |
||||
|
||||
pythonImportsCheck = [ "dalle_mini" ]; |
||||
|
||||
meta = with lib; { |
||||
description = "Generate images from a text prompt"; |
||||
homepage = "https://github.com/borisdayma/dalle-mini"; |
||||
license = licenses.asl20; |
||||
maintainers = with maintainers; [ r-burns ]; |
||||
}; |
||||
} |
@ -0,0 +1,46 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchFromGitHub |
||||
, flax |
||||
, jax |
||||
, jaxlib |
||||
, transformers |
||||
}: |
||||
|
||||
buildPythonPackage rec { |
||||
pname = "vqgan-jax"; |
||||
version = "unstable-2022-04-20"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "patil-suraj"; |
||||
repo = "vqgan-jax"; |
||||
rev = "1be20eee476e5d35c30e4ec3ed12222018af8ce4"; |
||||
sha256 = "sha256-OZihAXpE0UsgauQ38XDmAF+lrIgz05uK0ro8SCdVsPc="; |
||||
}; |
||||
|
||||
format = "setuptools"; |
||||
|
||||
buildInputs = [ |
||||
jaxlib |
||||
]; |
||||
|
||||
propagatedBuildInputs = [ |
||||
flax |
||||
jax |
||||
transformers |
||||
]; |
||||
|
||||
doCheck = false; |
||||
|
||||
pythonImportsCheck = [ |
||||
"vqgan_jax" |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
description = "JAX implementation of VQGAN"; |
||||
homepage = "https://github.com/patil-suraj/vqgan-jax"; |
||||
# license unknown: https://github.com/patil-suraj/vqgan-jax/issues/9 |
||||
license = lib.licenses.unfree; |
||||
maintainers = with maintainers; [ r-burns ]; |
||||
}; |
||||
} |
Loading…
Reference in new issue