uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,104 @@
|
|||
From 4a0584f7c05641143151ebdc1be1163bebf9d35d Mon Sep 17 00:00:00 2001
|
||||
From: Las <las@protonmail.ch>
|
||||
Date: Sun, 3 Jan 2021 18:35:37 +0000
|
||||
Subject: [PATCH] Compile transupp.c as part of the library
|
||||
|
||||
The exported symbols are made weak to not conflict with users
|
||||
of the library that already vendor this functionality.
|
||||
---
|
||||
CMakeLists.txt | 4 ++--
|
||||
transupp.c | 14 +++++++-------
|
||||
2 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0ca6f98..a9a0fae 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -533,7 +533,7 @@ set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
|
||||
jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
|
||||
jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
|
||||
jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
|
||||
- jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
|
||||
+ jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c transupp.c)
|
||||
|
||||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
|
||||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
|
||||
@@ -1489,7 +1489,7 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
|
||||
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
|
||||
+ ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h ${CMAKE_CURRENT_SOURCE_DIR}/transupp.h
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
include(cmakescripts/BuildPackages.cmake)
|
||||
diff --git a/transupp.c b/transupp.c
|
||||
index 6e86077..2da49a7 100644
|
||||
--- a/transupp.c
|
||||
+++ b/transupp.c
|
||||
@@ -1386,7 +1386,7 @@ jt_read_integer(const char **strptr, JDIMENSION *result)
|
||||
* This code is loosely based on XParseGeometry from the X11 distribution.
|
||||
*/
|
||||
|
||||
-GLOBAL(boolean)
|
||||
+GLOBAL(boolean) __attribute__((weak))
|
||||
jtransform_parse_crop_spec(jpeg_transform_info *info, const char *spec)
|
||||
{
|
||||
info->crop = FALSE;
|
||||
@@ -1486,7 +1486,7 @@ trim_bottom_edge(jpeg_transform_info *info, JDIMENSION full_height)
|
||||
* and transformation is not perfect. Otherwise returns TRUE.
|
||||
*/
|
||||
|
||||
-GLOBAL(boolean)
|
||||
+GLOBAL(boolean) __attribute__((weak))
|
||||
jtransform_request_workspace(j_decompress_ptr srcinfo,
|
||||
jpeg_transform_info *info)
|
||||
{
|
||||
@@ -2033,7 +2033,7 @@ adjust_exif_parameters(JOCTET *data, unsigned int length, JDIMENSION new_width,
|
||||
* to jpeg_write_coefficients().
|
||||
*/
|
||||
|
||||
-GLOBAL(jvirt_barray_ptr *)
|
||||
+GLOBAL(jvirt_barray_ptr *) __attribute__((weak))
|
||||
jtransform_adjust_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
|
||||
jvirt_barray_ptr *src_coef_arrays,
|
||||
jpeg_transform_info *info)
|
||||
@@ -2152,7 +2152,7 @@ jtransform_adjust_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
|
||||
* Note that some transformations will modify the source data arrays!
|
||||
*/
|
||||
|
||||
-GLOBAL(void)
|
||||
+GLOBAL(void) __attribute__((weak))
|
||||
jtransform_execute_transform(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
|
||||
jvirt_barray_ptr *src_coef_arrays,
|
||||
jpeg_transform_info *info)
|
||||
@@ -2264,7 +2264,7 @@ jtransform_execute_transform(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
|
||||
* (may use custom action then)
|
||||
*/
|
||||
|
||||
-GLOBAL(boolean)
|
||||
+GLOBAL(boolean) __attribute__((weak))
|
||||
jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
|
||||
int MCU_width, int MCU_height,
|
||||
JXFORM_CODE transform)
|
||||
@@ -2303,7 +2303,7 @@ jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
|
||||
* This must be called before jpeg_read_header() to have the desired effect.
|
||||
*/
|
||||
|
||||
-GLOBAL(void)
|
||||
+GLOBAL(void) __attribute__((weak))
|
||||
jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
|
||||
{
|
||||
#ifdef SAVE_MARKERS_SUPPORTED
|
||||
@@ -2331,7 +2331,7 @@ jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
|
||||
* JFIF APP0 or Adobe APP14 markers if selected.
|
||||
*/
|
||||
|
||||
-GLOBAL(void)
|
||||
+GLOBAL(void) __attribute__((weak))
|
||||
jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
|
||||
JCOPY_OPTION option)
|
||||
{
|
||||
--
|
||||
2.29.2
|
||||
|
||||
71
pkgs/development/libraries/libjpeg-turbo/default.nix
Normal file
71
pkgs/development/libraries/libjpeg-turbo/default.nix
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, nasm
|
||||
, openjdk
|
||||
, enableJava ? false # whether to build the java wrapper
|
||||
, enableJpeg7 ? false # whether to build libjpeg with v7 compatibility
|
||||
, enableJpeg8 ? false # whether to build libjpeg with v8 compatibility
|
||||
, enableStatic ? stdenv.hostPlatform.isStatic
|
||||
, enableShared ? !stdenv.hostPlatform.isStatic
|
||||
}:
|
||||
|
||||
assert !(enableJpeg7 && enableJpeg8); # pick only one or none, not both
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
||||
pname = "libjpeg-turbo";
|
||||
version = "2.1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libjpeg-turbo";
|
||||
repo = "libjpeg-turbo";
|
||||
rev = version;
|
||||
sha256 = "sha256-GbOYoCNAsOESXrEsBb6OHVB4TKhPUEU04PBp8qXVMug=";
|
||||
};
|
||||
|
||||
# This is needed by freeimage
|
||||
patches = [ ./0001-Compile-transupp.c-as-part-of-the-library.patch ]
|
||||
++ lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
|
||||
./mingw-boolean.patch;
|
||||
|
||||
outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
|
||||
|
||||
postFixup = ''
|
||||
moveToOutput include/transupp.h $dev_private
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
nasm
|
||||
] ++ lib.optionals enableJava [
|
||||
openjdk
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DENABLE_STATIC=${if enableStatic then "1" else "0"}"
|
||||
"-DENABLE_SHARED=${if enableShared then "1" else "0"}"
|
||||
] ++ lib.optionals enableJava [
|
||||
"-DWITH_JAVA=1"
|
||||
] ++ lib.optionals enableJpeg7 [
|
||||
"-DWITH_JPEG7=1"
|
||||
] ++ lib.optionals enableJpeg8 [
|
||||
"-DWITH_JPEG8=1"
|
||||
] ++ lib.optionals stdenv.hostPlatform.isRiscV [
|
||||
# https://github.com/libjpeg-turbo/libjpeg-turbo/issues/428
|
||||
# https://github.com/libjpeg-turbo/libjpeg-turbo/commit/88bf1d16786c74f76f2e4f6ec2873d092f577c75
|
||||
"-DFLOATTEST=fp-contract"
|
||||
];
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckTarget = "test";
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://libjpeg-turbo.org/";
|
||||
description = "A faster (using SIMD) libjpeg implementation";
|
||||
license = licenses.ijg; # and some parts under other BSD-style licenses
|
||||
maintainers = with maintainers; [ vcunat colemickens kamadorueda ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
19
pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
Normal file
19
pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Ported to updated libjpeg-turbo from
|
||||
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch
|
||||
--- a/jmorecfg.h 2012-02-10 06:47:55 +0300
|
||||
+++ b/jmorecfg.h 2012-05-03 10:29:13 +0400
|
||||
@@ -224,7 +224,13 @@
|
||||
* Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
|
||||
*/
|
||||
|
||||
-#ifndef HAVE_BOOLEAN
|
||||
+#if defined(_WIN32) && !defined(HAVE_BOOLEAN)
|
||||
+#ifndef __RPCNDR_H__
|
||||
+typedef unsigned char boolean;
|
||||
+#endif
|
||||
+#define HAVE_BOOLEAN
|
||||
+#endif
|
||||
+#if !defined(HAVE_BOOLEAN) && !defined(__RPCNDR_H__)
|
||||
typedef int boolean;
|
||||
#endif
|
||||
#ifndef FALSE /* in case these macros already exist */
|
||||
Loading…
Add table
Add a link
Reference in a new issue