diff --git a/dev-utils/yasm/yasm-1.3.0-20190723.diff b/dev-utils/yasm/yasm-1.3.0-20190723.diff new file mode 100644 index 00000000..ded3148b --- /dev/null +++ b/dev-utils/yasm/yasm-1.3.0-20190723.diff @@ -0,0 +1,96 @@ +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x '*\.o' -x '*\.pyc' yasm-1.3.0.orig/frontends/yasm/yasm-plugin.c yasm-1.3.0/frontends/yasm/yasm-plugin.c +--- yasm-1.3.0.orig/frontends/yasm/yasm-plugin.c 2014-08-11 08:18:52.000000000 +0200 ++++ yasm-1.3.0/frontends/yasm/yasm-plugin.c 2019-07-23 17:47:56.000000000 +0200 +@@ -31,7 +31,7 @@ + #include "libyasm-stdint.h" + #include "yasm-plugin.h" + +-#if defined(_MSC_VER) ++#if defined(_WIN32) + #include + #elif defined(__GNUC__) + #include +@@ -43,7 +43,7 @@ + static void * + load_dll(const char *name) + { +-#if defined(_MSC_VER) ++#if defined(_WIN32) + return LoadLibrary(name); + #elif defined(__GNUC__) + return dlopen(name, RTLD_NOW); +@@ -62,7 +62,7 @@ + /* Load library */ + + path = yasm_xmalloc(strlen(name)+10); +-#if defined(_MSC_VER) ++#if defined(_WIN32) + strcpy(path, name); + strcat(path, ".dll"); + lib = load_dll(path); +@@ -92,7 +92,7 @@ + + /* Get yasm_init_plugin() function and run it */ + +-#if defined(_MSC_VER) ++#if defined(_WIN32) + init_plugin = + (void (*)(void))GetProcAddress((HINSTANCE)lib, "yasm_init_plugin"); + #elif defined(__GNUC__) +@@ -115,7 +115,7 @@ + return; + + for (i = 0; i < num_loaded_plugins; i++) { +-#if defined(_MSC_VER) ++#if defined(_WIN32) + FreeLibrary((HINSTANCE)loaded_plugins[i]); + #elif defined(__GNUC__) + dlclose(loaded_plugins[i]); +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x '*\.o' -x '*\.pyc' yasm-1.3.0.orig/libyasm-stdint.h.cmake yasm-1.3.0/libyasm-stdint.h.cmake +--- yasm-1.3.0.orig/libyasm-stdint.h.cmake 2014-08-11 08:18:52.000000000 +0200 ++++ yasm-1.3.0/libyasm-stdint.h.cmake 2019-07-23 17:51:49.000000000 +0200 +@@ -26,7 +26,7 @@ + #endif + + #ifndef YASM_LIB_DECL +-# if defined(BUILD_SHARED_LIBS) && defined(_MSC_VER) ++# if defined(BUILD_SHARED_LIBS) && defined(_WIN32) + # ifdef YASM_LIB_SOURCE + # define YASM_LIB_DECL __declspec(dllexport) + # else +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x '*\.o' -x '*\.pyc' yasm-1.3.0.orig/modules/CMakeLists.txt yasm-1.3.0/modules/CMakeLists.txt +--- yasm-1.3.0.orig/modules/CMakeLists.txt 2014-08-11 08:18:52.000000000 +0200 ++++ yasm-1.3.0/modules/CMakeLists.txt 2019-07-23 17:51:30.000000000 +0200 +@@ -57,7 +57,7 @@ + "extern yasm_${_type}_module yasm_${_keyword}_LTX_${_type};\n") + ENDFOREACH(module) + IF(BUILD_SHARED_LIBS) +- FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _MSC_VER\n") ++ FILE(APPEND ${INIT_PLUGIN_C} "\n#ifdef _WIN32\n") + FILE(APPEND ${INIT_PLUGIN_C} "__declspec(dllexport)\n") + FILE(APPEND ${INIT_PLUGIN_C} "#endif\n") + ENDIF(BUILD_SHARED_LIBS) +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x '*\.o' -x '*\.pyc' yasm-1.3.0.orig/plugins/dbg/init_plugin.c yasm-1.3.0/plugins/dbg/init_plugin.c +--- yasm-1.3.0.orig/plugins/dbg/init_plugin.c 2014-08-11 08:18:52.000000000 +0200 ++++ yasm-1.3.0/plugins/dbg/init_plugin.c 2019-07-23 17:51:37.000000000 +0200 +@@ -3,7 +3,7 @@ + + extern yasm_arch_module yasm_dbg_LTX_objfmt; + +-#ifdef _MSC_VER ++#ifdef _WIN32 + __declspec(dllexport) + #endif + void +diff -Nrub -x '*~' -x '*\.rej' -x '*\.orig' -x '*\.o' -x '*\.pyc' yasm-1.3.0.orig/plugins/x86/init_plugin.c yasm-1.3.0/plugins/x86/init_plugin.c +--- yasm-1.3.0.orig/plugins/x86/init_plugin.c 2014-08-11 08:18:52.000000000 +0200 ++++ yasm-1.3.0/plugins/x86/init_plugin.c 2019-07-23 17:51:45.000000000 +0200 +@@ -3,7 +3,7 @@ + + extern yasm_arch_module yasm_x86_LTX_arch; + +-#ifdef _MSC_VER ++#ifdef _WIN32 + __declspec(dllexport) + #endif + void diff --git a/dev-utils/yasm/yasm.py b/dev-utils/yasm/yasm.py index dd503016..63daa739 100644 --- a/dev-utils/yasm/yasm.py +++ b/dev-utils/yasm/yasm.py @@ -1,59 +1,60 @@ # -*- coding: utf-8 -*- # Copyright 2018 Łukasz Wojniłowicz # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. import info class subinfo(info.infoclass): def setTargets(self): self.targets['1.3.0'] = "https://github.com/yasm/yasm/archive/v1.3.0.tar.gz" self.archiveNames["1.3.0"] = "yasm-1.3.0.tar.gz" self.targetDigests['1.3.0'] = (['f708be0b7b8c59bc1dbe7134153cd2f31faeebaa8eec48676c10f972a1f13df3'], CraftHash.HashAlgorithm.SHA256) self.targetInstSrc['1.3.0'] = "yasm-1.3.0" self.targetInstallPath["1.3.0"] = "dev-utils" + self.patchToApply["1.3.0"] = [("yasm-1.3.0-20190723.diff", 1)] self.description = "The Yasm Modular Assembler Project" self.defaultTarget = '1.3.0' def setDependencies(self): if CraftCore.compiler.isUnix: self.buildDependencies["libs/gettext"] = None self.buildDependencies["libs/iconv"] = None self.buildDependencies["dev-utils/intltool"] = None self.buildDependencies["dev-utils/cmake"] = None self.runtimeDependencies["virtual/bin-base"] = None from Package.AutoToolsPackageBase import * from Package.CMakePackageBase import * if CraftCore.compiler.isUnix: class Package(AutoToolsPackageBase): def __init__(self, **args): AutoToolsPackageBase.__init__(self) else: class Package(CMakePackageBase): def __init__(self, **args): CMakePackageBase.__init__(self)