View Issue Details

IDProjectCategoryView StatusLast Update
0013712ScribusBuild Systempublic2016-11-10 22:41
Reporterjlpoole Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityN/A
Status assignedResolutionopen 
PlatformWinOSx64OS VersionWindows 7
Product Version1.5.1svn 
Summary0013712: Patch for Automatic Subversion Revision Number Incorporation Into Code
DescriptionHere's a patch so that builds on Visual Studio (13 express) will cause the Subversion Revision number to appear in the project.
TagsNo tags attached.
PatchNo

Activities

jlpoole

2016-02-07 20:36

reporter  

win_svn.patch (2,293 bytes)   
Index: vc11/scribus-pgf/scribus-pgf.vcxproj.user
===================================================================
--- vc11/scribus-pgf/scribus-pgf.vcxproj.user	(nonexistent)
+++ vc11/scribus-pgf/scribus-pgf.vcxproj.user	(working copy)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+</Project>
\ No newline at end of file
Index: vc11/svn_version.h
===================================================================
--- vc11/svn_version.h	(nonexistent)
+++ vc11/svn_version.h	(working copy)
@@ -0,0 +1,9 @@
+#ifndef _SVN_VERSION_H_
+#define _SVN_VERSION_H_
+ 
+#define SVN_LOCAL_MODIFICATIONS 1  // 1 if there are modifications to the local working copy, 0 otherwise
+#define SVN_REVISION            20937       // Highest committed revision number in the working copy
+#define SVNVERSION              20937       // for scribus/ui/about.cpp
+#define SVN_TIME_NOW            2016/02/07 11:18:14       // Current system date &amp; time
+ 
+#endif
\ No newline at end of file
Index: vc11/svn_version.h.tmpl
===================================================================
--- vc11/svn_version.h.tmpl	(nonexistent)
+++ vc11/svn_version.h.tmpl	(working copy)
@@ -0,0 +1,9 @@
+#ifndef _SVN_VERSION_H_
+#define _SVN_VERSION_H_
+ 
+#define SVN_LOCAL_MODIFICATIONS $WCMODS?1:0$  // 1 if there are modifications to the local working copy, 0 otherwise
+#define SVN_REVISION            $WCREV$       // Highest committed revision number in the working copy
+#define SVNVERSION              $WCREV$       // for scribus/ui/about.cpp
+#define SVN_TIME_NOW            $WCNOW$       // Current system date &amp; time
+ 
+#endif
\ No newline at end of file
Index: vc11/win-config.h
===================================================================
--- vc11/win-config.h	(revision 20933)
+++ vc11/win-config.h	(working copy)
@@ -4,6 +4,9 @@
 /* Version number of package */
 #define VERSION "1.5.1.svn"
 
+/* For windows, we need this to trigger windows build, in Linux there is a CMAKE module that handles this */
+#define HAVE_SVNVERSION 1
+
 /* Are we building win32 native version. */
 #define BUILD_WINDOWS_VERSION 1
 
win_svn.patch (2,293 bytes)   

jghali

2016-02-08 00:18

administrator   ~0038558

The patch is not correct: the svn version file has to be named svnversion.h and not svn_version.h. Also adding the svnversion.h file should not be necessary as subwcrev can be called from visual studio at build time so as to generate the svn version header.

jlpoole

2016-02-08 01:27

reporter  

win_svnB.patch (5,661 bytes)   
Index: vc11/scribus-pgf/scribus-pgf.vcxproj
===================================================================
--- vc11/scribus-pgf/scribus-pgf.vcxproj	(revision 20933)
+++ vc11/scribus-pgf/scribus-pgf.vcxproj	(working copy)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
@@ -26,24 +26,24 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
     <WholeProgramOptimization>false</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
     <WholeProgramOptimization>false</WholeProgramOptimization>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v110</PlatformToolset>
+    <PlatformToolset>v120</PlatformToolset>
     <CharacterSet>Unicode</CharacterSet>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -104,6 +104,12 @@
       <DisableSpecificWarnings>4005;4244;4251;4258;4267;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Lib />
+    <PreBuildEvent>
+      <Command>SubWCRev.exe ..\..\..\..  ..\svn_version.h.tmpl ..\..\..\scribus\ui\svnversion.h</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Automatic Subversion Revision Inclusion into Code</Message>
+    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
@@ -119,6 +125,12 @@
       <DisableSpecificWarnings>4005;4244;4251;4258;4267;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Lib />
+    <PreBuildEvent>
+      <Command>SubWCRev.exe ..\..\..\..  ..\svn_version.h.tmpl ..\..\..\scribus\ui\svnversion.h</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Automatic Subversion Revision Inclusion into Code</Message>
+    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
@@ -134,6 +146,12 @@
       <DisableSpecificWarnings>4005;4244;4251;4258;4267;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Lib />
+    <PreBuildEvent>
+      <Command>SubWCRev.exe ..\..\..\..  ..\svn_version.h.tmpl ..\..\..\scribus\ui\svnversion.h</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Automatic Subversion Revision Inclusion into Code</Message>
+    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
@@ -150,6 +168,12 @@
       <DisableSpecificWarnings>4005;4244;4251;4258;4267;4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
     </ClCompile>
     <Lib />
+    <PreBuildEvent>
+      <Command>SubWCRev.exe ..\..\..\..  ..\svn_version.h.tmpl ..\..\..\scribus\ui\svnversion.h</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Automatic Subversion Revision Inclusion into Code</Message>
+    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\..\scribus\third_party\pgf\Decoder.cpp" />
Index: vc11/svn_version.h.tmpl
===================================================================
--- vc11/svn_version.h.tmpl	(nonexistent)
+++ vc11/svn_version.h.tmpl	(working copy)
@@ -0,0 +1,9 @@
+#ifndef _SVN_VERSION_H_
+#define _SVN_VERSION_H_
+ 
+#define SVN_LOCAL_MODIFICATIONS $WCMODS?1:0$  // 1 if there are modifications to the local working copy, 0 otherwise
+#define SVNVERSION              $WCREV$       // Highest committed revision number in the working copy
+                                              // for scribus/ui/about.cpp
+#define SVN_TIME_NOW            $WCNOW$       // Current system date &amp; time
+ 
+#endif
\ No newline at end of file
Index: vc11/win-config.h
===================================================================
--- vc11/win-config.h	(revision 20933)
+++ vc11/win-config.h	(working copy)
@@ -4,6 +4,9 @@
 /* Version number of package */
 #define VERSION "1.5.1.svn"
 
+/* For windows, we need this to trigger windows build, in Linux there is a CMAKE module that handles this */
+#define HAVE_SVNVERSION 1
+
 /* Are we building win32 native version. */
 #define BUILD_WINDOWS_VERSION 1
 
win_svnB.patch (5,661 bytes)   

jlpoole

2016-02-08 01:28

reporter   ~0038559

You're right. I apologize. Th first patch I submitted is all wrong.

I've uploaded win_svnB.patch which was created at the node D:\Temp\scribus\Scribus\win32 instead of at the project's root for the TortoiseSVN client gets
overwhelmed by the quantity of files it tries to assess for creating a patch.

I hope this helps.

Kunda

2016-02-08 16:06

updater   ~0038560

@jlpoole awesome! Thanks for your efforts on this!

Kunda

2016-02-11 19:08

updater   ~0038648

jlpoole, BTW, thanks for building windows HEAD! The only difference it seems between your snapshot and jghali's (https://sourceforge.net/projects/scribus/files/scribus-svn/1.5.1.svn/ beside the fact that he hasn't updated to the latest HEAD) is that his builds work on windows XP.

Nevertheless, it would be awesome if you could possibly contribute to the tutorial that already exists but is still quite not comprehensive enough to build Windows from source ? OR perhaps creating an MSI package?

jlpoole

2016-02-11 19:55

reporter   ~0038649

From my email to the dev list on 2/7

I'll be documenting, in detail, on the wiki how building on Windows for Windows 7 is done as soon as I can set up a virgin build of Windows 7 so I can document everything that is added to accomplish this task. I integrated Perl into my workbench and tool chain, it can elegantly accomplish the complex file shuffling and variable substitution that plagues the Windows build using Microsoft Visual Studio.

Eventually, I'd like to use CMAKE in Linux with a cross-compiler (win-builds project) to build Windows versions thereby jettisoning the MS Tools and keeping life simple in one build environment -- if only I had more time.

Kunda

2016-11-10 22:33

updater   ~0042385

Though the windows version of scribus dev isn't really relevant for my workflow, I'm on a quest to get the SVN version functionality working on all platforms so that includes windows. so @jghali does @jlpoole patch address this and is it merge-able in to trunk?

jlpoole

2016-11-10 22:41

reporter   ~0042386

I recall it being written that the Perl tools were not necessary nor desirable & nadda nadda (a negative form of "yadda yadda"). So aware of this perspective, I just dropped the effort/project.

Issue History

Date Modified Username Field Change
2016-02-07 20:36 jlpoole New Issue
2016-02-07 20:36 jlpoole File Added: win_svn.patch
2016-02-08 00:18 jghali Note Added: 0038558
2016-02-08 01:27 jlpoole File Added: win_svnB.patch
2016-02-08 01:28 jlpoole Note Added: 0038559
2016-02-08 16:06 Kunda Note Added: 0038560
2016-02-10 21:03 cbradney Assigned To => jghali
2016-02-10 21:03 cbradney Status new => assigned
2016-02-11 19:08 Kunda Note Added: 0038648
2016-02-11 19:55 jlpoole Note Added: 0038649
2016-11-10 22:33 Kunda Note Added: 0042385
2016-11-10 22:41 jlpoole Note Added: 0042386