diff --git a/CMakeLists.txt b/CMakeLists.txt index ed58ca8..406da98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 2.8) project(jxrlib C) -include(GNUInstallDirs) set(JXRLIB_MAJOR 0) set(JXRLIB_MINOR 0) @@ -31,9 +30,9 @@ add_library(jpegxr ${jpegxr_SRC} ${jpegxr_HDR}) set_target_properties(jpegxr PROPERTIES VERSION ${JXRLIB_LIB_VERSION} SOVERSION ${JXRLIB_SO_VERSION}) install(TARGETS jpegxr - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} ) # JXR-GLUE Library @@ -45,25 +44,25 @@ set_target_properties(jxrglue PROPERTIES VERSION ${JXRLIB_LIB_VERSION} SOVERSION target_link_libraries(jxrglue jpegxr m) install(TARGETS jxrglue - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX} ) # JxrEncApp Executable add_executable(JxrEncApp jxrencoderdecoder/JxrEncApp.c) target_link_libraries(JxrEncApp jxrglue) -install(TARGETS JxrEncApp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(TARGETS JxrEncApp RUNTIME DESTINATION bin) # JxrDecApp Executable add_executable(JxrDecApp jxrencoderdecoder/JxrDecApp.c) target_link_libraries(JxrDecApp jxrglue) -install(TARGETS JxrDecApp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(TARGETS JxrDecApp RUNTIME DESTINATION bin) # Headers install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrtestlib/JXRTest.h image/sys/windowsmediaphoto.h - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jxrlib + DESTINATION include/jxrlib ) -install(DIRECTORY common/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jxrlib +install(DIRECTORY common/include/ DESTINATION include/jxrlib FILES_MATCHING PATTERN "*.h" ) diff --git a/jxrlib.spec b/jxrlib.spec index 85602f1..5571397 100644 --- a/jxrlib.spec +++ b/jxrlib.spec @@ -1,12 +1,11 @@ Name: jxrlib Version: 1.1 -Release: 32%{?dist} +Release: 5%{?dist} Summary: Open source implementation of jpegxr # See JPEGXR_DPK_Spec_1.0.doc. Upstream request for plain text license file at # https://jxrlib.codeplex.com/workitem/13 -# Automatically converted from old format: BSD - review is highly recommended. -License: LicenseRef-Callaway-BSD +License: BSD URL: https://jxrlib.codeplex.com/ Source0: http://jxrlib.codeplex.com/downloads/get/685249#/jxrlib_%(echo %{version} | tr . _).tar.gz # Use CMake to build to facilitate creation of shared libraries @@ -19,17 +18,8 @@ Source2: JPEGXR_DPK_Spec_1.0.pdf # Fix various warnings, upstreamable # See https://jxrlib.codeplex.com/workitem/13 Patch0: jxrlib_warnings.patch -# Mingw build fixes -Patch1: jxrlib_mingw.patch BuildRequires: cmake -BuildRequires: gcc - -BuildRequires: mingw32-filesystem >= 95 -BuildRequires: mingw32-gcc - -BuildRequires: mingw64-filesystem >= 95 -BuildRequires: mingw64-gcc %description @@ -45,24 +35,6 @@ The %{name}-devel package contains libraries and header files for developing applications that use %{name}. -%package -n mingw32-%{name} -Summary: MinGW Windows JPEG XR library -BuildArch: noarch - -%description -n mingw32-%{name} -MinGW Windows JPEG XR library. - - -%package -n mingw64-%{name} -Summary: MinGW Windows JPEG XR library -BuildArch: noarch - -%description -n mingw64-%{name} -MinGW Windows JPEG XR library. - - -%{?mingw_debug_package} - %prep %setup -q -n %{name} @@ -74,8 +46,7 @@ for file in `find . -type f -name '*.c' -or -name '*.h' -or -name '*.txt'`; do touch -r $file $file.new && mv $file.new $file done -%patch -P0 -p1 -%patch -P1 -p1 +%patch0 -p1 # Remove shipped binaries rm -rf bin @@ -85,25 +56,17 @@ cp -a %{SOURCE2} doc %build -# Native build -%cmake -%cmake_build - -# MinGW build -%mingw_cmake -%mingw_make_build +%cmake . +make %{?_smp_mflags} %install -%cmake_install -%mingw_make_install - -# Delete guiddef.h which conflicts with guiddef.h shipped by mingw-headers -rm -f %{buildroot}%{mingw32_includedir}/jxrlib/guiddef.h -rm -f %{buildroot}%{mingw64_includedir}/jxrlib/guiddef.h +%make_install -%mingw_debug_install_post +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig %files @@ -118,108 +81,8 @@ rm -f %{buildroot}%{mingw64_includedir}/jxrlib/guiddef.h %{_libdir}/libjpegxr.so %{_libdir}/libjxrglue.so -%files -n mingw32-%{name} -%{mingw32_bindir}/libjpegxr.dll -%{mingw32_bindir}/libjxrglue.dll -%{mingw32_bindir}/JxrDecApp.exe -%{mingw32_bindir}/JxrEncApp.exe -%{mingw32_includedir}/jxrlib/ -%{mingw32_libdir}/libjpegxr.dll.a -%{mingw32_libdir}/libjxrglue.dll.a - -%files -n mingw64-%{name} -%{mingw64_bindir}/libjpegxr.dll -%{mingw64_bindir}/libjxrglue.dll -%{mingw64_bindir}/JxrDecApp.exe -%{mingw64_bindir}/JxrEncApp.exe -%{mingw64_includedir}/jxrlib/ -%{mingw64_libdir}/libjpegxr.dll.a -%{mingw64_libdir}/libjxrglue.dll.a - %changelog -* Thu Jul 24 2025 Fedora Release Engineering - 1.1-32 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Wed Jul 16 2025 Sandro Mani - 1.1-31 -- Increase minimum cmake version to 3.5 -- Port CMakeLists.txt to GNUInstallDirs - -* Fri Jan 17 2025 Fedora Release Engineering - 1.1-30 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Mon Sep 02 2024 Miroslav Suchý - 1.1-29 -- convert license to SPDX - -* Thu Jul 18 2024 Fedora Release Engineering - 1.1-28 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Wed Jan 24 2024 Fedora Release Engineering - 1.1-27 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Sat Jan 20 2024 Fedora Release Engineering - 1.1-26 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Thu Jul 20 2023 Fedora Release Engineering - 1.1-25 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Thu Jan 19 2023 Fedora Release Engineering - 1.1-24 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Fri Aug 05 2022 Sandro Mani - 1.1-23 -- Don't install guiddef.h for mingw - -* Thu Jul 21 2022 Fedora Release Engineering - 1.1-22 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Fri Mar 25 2022 Sandro Mani - 1.1-21 -- Rebuild with mingw-gcc-12 - -* Thu Feb 24 2022 Sandro Mani - 1.1-20 -- Make mingw subpackages noarch - -* Sun Feb 20 2022 Sandro Mani - 1.1-19 -- Add mingw subpackege - -* Thu Jan 20 2022 Fedora Release Engineering - 1.1-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Thu Jul 22 2021 Fedora Release Engineering - 1.1-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Jan 26 2021 Fedora Release Engineering - 1.1-16 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Tue Jul 28 2020 Fedora Release Engineering - 1.1-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Wed Jan 29 2020 Fedora Release Engineering - 1.1-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Jul 25 2019 Fedora Release Engineering - 1.1-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Feb 01 2019 Fedora Release Engineering - 1.1-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Fri Jul 13 2018 Fedora Release Engineering - 1.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Sun Feb 18 2018 Sandro Mani - 1.1-10 -- Add missing BR: gcc, make - -* Wed Feb 07 2018 Fedora Release Engineering - 1.1-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Aug 03 2017 Fedora Release Engineering - 1.1-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Wed Jul 26 2017 Fedora Release Engineering - 1.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Fri Feb 10 2017 Fedora Release Engineering - 1.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - * Thu Feb 04 2016 Fedora Release Engineering - 1.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild diff --git a/jxrlib_mingw.patch b/jxrlib_mingw.patch deleted file mode 100644 index 3b3e45d..0000000 --- a/jxrlib_mingw.patch +++ /dev/null @@ -1,94 +0,0 @@ -diff -rupN jxrlib/common/include/wmspecstring.h jxrlib-new/common/include/wmspecstring.h ---- jxrlib/common/include/wmspecstring.h 2013-03-21 18:58:18.000000000 +0100 -+++ jxrlib-new/common/include/wmspecstring.h 2015-09-06 21:10:53.943039237 +0200 -@@ -334,7 +334,7 @@ void __pfx_assume(int, const char *); - - // Some CE versions don't have specstrings.h, some have very old version without - // __specstrings defined. So we handle CE separately in wmasalce.h --#if defined(UNDER_CE) || defined(NO_WINDOWS) -+#if defined(UNDER_CE) || defined(NO_WINDOWS) || defined(MINGW) - #include "wmspecstringce.h" - #endif - -diff -rupN jxrlib/image/sys/ansi.h jxrlib-new/image/sys/ansi.h ---- jxrlib/image/sys/ansi.h 2013-03-28 18:34:06.000000000 +0100 -+++ jxrlib-new/image/sys/ansi.h 2015-09-06 21:18:54.051637086 +0200 -@@ -44,13 +44,9 @@ - //================================ - #define FORCE_INLINE - #define CDECL --#if __LP64__ --#define UINTPTR_T unsigned long long --#define INTPTR_T long long --#else --#define UINTPTR_T unsigned int --#define INTPTR_T int --#endif -+#include -+#define UINTPTR_T uintptr_t -+#define INTPTR_T intptr_t - - - //================================ -diff -rupN jxrlib/image/sys/strcodec.h jxrlib-new/image/sys/strcodec.h ---- jxrlib/image/sys/strcodec.h 2015-09-06 02:21:20.337316724 +0200 -+++ jxrlib-new/image/sys/strcodec.h 2015-09-06 21:18:44.335483326 +0200 -@@ -40,7 +40,7 @@ - - //================================================================ - #ifdef ENABLE_OPTIMIZATIONS --#if defined(WIN32) && !defined(_WIN64) -+#if defined(_MSC_VER) && !defined(_WIN64) - #define WMP_OPT_SSE2 - - #define WMP_OPT_CC_ENC -@@ -57,9 +57,9 @@ - - //================================================================ - //#ifdef WIN32 --#if defined(WIN32) && !defined(UNDER_CE) // WIN32 seems to be defined always in VS2005 for ARM platform -+#if defined(_MSC_VER) && !defined(UNDER_CE) // WIN32 seems to be defined always in VS2005 for ARM platform - #define PLATFORM_X86 --#include "..\x86\x86.h" -+#include "../x86/x86.h" - #endif - - #ifndef UNREFERENCED_PARAMETER -@@ -89,6 +89,7 @@ typedef unsigned __int64 U64; - - // The following macros depend on UINTPTR_T and INTPTR_T being properly defined - // so that they are equal to pointer width. Confirm and fail if our assumptions are wrong. -+ - CT_ASSERT(sizeof(UINTPTR_T) == sizeof(void*), strcodec1); - CT_ASSERT(sizeof(INTPTR_T) == sizeof(void*), strcodec2); - -@@ -450,7 +451,7 @@ typedef struct CWMImageStrCodec { - - struct WMPStream ** ppWStream; - --#ifdef WIN32 -+#ifdef _MSC_VER - TCHAR **ppTempFile; - #else - char **ppTempFile; -diff -rupN jxrlib/jxrgluelib/JXRMeta.h jxrlib-new/jxrgluelib/JXRMeta.h ---- jxrlib/jxrgluelib/JXRMeta.h 2015-09-06 02:21:20.340316728 +0200 -+++ jxrlib-new/jxrgluelib/JXRMeta.h 2015-09-06 21:10:53.944039253 +0200 -@@ -28,7 +28,7 @@ - #pragma once - - #include --#ifndef WIN32 -+#ifndef _MSC_VER - #include - #endif - -@@ -106,7 +106,7 @@ - #define WMP_valWMPhotoID WMP_valCompression - - --#ifdef WIN32 -+#ifdef _MSC_VER - #define __in_win __in - #define __out_win __out - #endif