Browse Source

Clean up Visual Studio build issues

DarkMorford 5 years ago
parent
commit
174c1d6b25
3 changed files with 78 additions and 1 deletions
  1. 6 1
      conanfile.py
  2. 12 0
      patches/framing.c.patch
  3. 60 0
      patches/ogg.def.patch

+ 6 - 1
conanfile.py

@@ -13,7 +13,7 @@ class LibOggConan(ConanFile):
                    "free for anyone to use.")
                    "free for anyone to use.")
     homepage = "https://www.xiph.org/ogg/"
     homepage = "https://www.xiph.org/ogg/"
     topics = ("xiph.org", "media", "container")
     topics = ("xiph.org", "media", "container")
-    exports_sources = ["CMakeLists.txt"]
+    exports_sources = ["CMakeLists.txt", "patches/*"]
     settings = "os", "compiler", "build_type", "arch"
     settings = "os", "compiler", "build_type", "arch"
     options = {"shared": [True, False]}
     options = {"shared": [True, False]}
     default_options = {"shared": False}
     default_options = {"shared": False}
@@ -25,6 +25,11 @@ class LibOggConan(ConanFile):
 
 
     def source(self):
     def source(self):
         tools.get(**self.conan_data["sources"][self.version])
         tools.get(**self.conan_data["sources"][self.version])
+        self._patch()
+
+    def _patch(self):
+        tools.patch(base_path=self.subfolder, patch_file=os.path.join("patches", "framing.c.patch"), strip=1)
+        tools.patch(base_path=self.subfolder, patch_file=os.path.join("patches", "ogg.def.patch"), strip=1)
 
 
     def configure(self):
     def configure(self):
         del self.settings.compiler.cppstd
         del self.settings.compiler.cppstd

+ 12 - 0
patches/framing.c.patch

@@ -0,0 +1,12 @@
+diff -Naru libogg-1.3.4.orig/src/framing.c libogg-1.3.4/src/framing.c
+--- libogg-1.3.4.orig/src/framing.c	2019-08-12 11:56:41.000000000 -0700
++++ libogg-1.3.4/src/framing.c	2019-12-08 15:03:21.609933200 -0800
+@@ -1564,7 +1564,7 @@
+             byteskipcount=byteskip;
+           }
+ 
+-          ogg_sync_wrote(&oy,next-buf);
++          ogg_sync_wrote(&oy,(long)(next-buf));
+ 
+           while(1){
+             int ret=ogg_sync_pageout(&oy,&og_de);

+ 60 - 0
patches/ogg.def.patch

@@ -0,0 +1,60 @@
+diff -Naru libogg-1.3.4.orig/win32/ogg.def libogg-1.3.4/win32/ogg.def
+--- libogg-1.3.4.orig/win32/ogg.def	2019-08-07 15:58:05.000000000 -0700
++++ libogg-1.3.4/win32/ogg.def	2019-12-08 15:44:07.799847300 -0800
+@@ -6,6 +6,7 @@
+ EXPORTS
+ ;
+ oggpack_writeinit
++oggpack_writecheck
+ oggpack_writetrunc
+ oggpack_writealign
+ oggpack_writecopy
+@@ -24,6 +25,7 @@
+ oggpack_get_buffer
+ ;
+ oggpackB_writeinit
++oggpackB_writecheck
+ oggpackB_writetrunc
+ oggpackB_writealign
+ oggpackB_writecopy
+@@ -42,13 +44,18 @@
+ oggpackB_get_buffer
+ ;
+ ogg_stream_packetin
++ogg_stream_iovecin
+ ogg_stream_pageout
++ogg_stream_pageout_fill
+ ogg_stream_flush
++ogg_stream_flush_fill
+ ;
+ ogg_sync_init
+ ogg_sync_clear
+ ogg_sync_reset
+ ogg_sync_destroy
++ogg_sync_check
++;
+ ogg_sync_buffer
+ ogg_sync_wrote
+ ogg_sync_pageseek
+@@ -62,11 +69,11 @@
+ ogg_stream_reset
+ ogg_stream_reset_serialno
+ ogg_stream_destroy
++ogg_stream_check
+ ogg_stream_eos
+-ogg_stream_pageout_fill
+-ogg_stream_flush_fill
+ ;
+ ogg_page_checksum_set
++;
+ ogg_page_version
+ ogg_page_continued
+ ogg_page_bos
+@@ -75,6 +82,5 @@
+ ogg_page_serialno
+ ogg_page_pageno
+ ogg_page_packets
++;
+ ogg_packet_clear
+-                                                        
+-