Skip to content
Browse files

build scripts make and zip also the windows plugin dll

  • Loading branch information...
1 parent 22a0f23 commit 50f3c8d3a419f01ecd80a6f220c224ab173ea123 @prof7bit committed Jun 16, 2012
View
1 .gitignore
@@ -8,6 +8,7 @@
*.exe
*.map
*.tar.bz2
+*.zip
src/gui/lib
src/purple/lib
src/tools/lib
View
4 src/purple/Makefile
@@ -30,8 +30,8 @@ clean:
## this is only for making the preview
-## binary that I upload to github
+## binaries that I upload to github
demo:
mkdir -p lib
fpc $(FPCOPT) -dDebugToConsole -dDebugToFile purpletorchat.lpr
-
+ fpc -Twin32 $(FPCOPT) -dDebugToConsole -dDebugToFile purpletorchat.lpr
View
44 src/tools/filetools.pas
@@ -11,10 +11,16 @@ function FCopy(A,B: String): Boolean;
function FMkDir(D: String): Boolean;
function FDelete(D: String): Boolean;
function FRename(A, B: String): Boolean;
+function FTar(A: String; F: array of AnsiString): String; // returns the archive name
function FZip(A: String; F: array of AnsiString): String; // returns the archive name
+
implementation
+const
+ TAR_EXE = '/bin/tar';
+ ZIP_EXE = '/usr/bin/zip';
+
function FCopy(A, B: String): Boolean;
var
Fa: TFileStream = nil;
@@ -37,12 +43,12 @@ function FCopy(A, B: String): Boolean;
except
Result := False;
if not Assigned(Fa) then
- WriteLn('FCopy: could not open ', A, ' for reading')
+ WriteLn('!!! FCopy: could not open ', A, ' for reading')
else
if not Assigned(Fb) then
- WriteLn('FCopy: could not open ', B, ' for writing')
+ WriteLn('!!! FCopy: could not open ', B, ' for writing')
else
- Writeln('FCopy: error while copying', LineEnding,
+ Writeln('!!! FCopy: error while copying', LineEnding,
' file ', A, LineEnding, ' to ', B);
end;
if Assigned(Fa) then Fa.Free;
@@ -74,44 +80,58 @@ function FDelete(D: String): Boolean;
RmDir(D);
except
Result := False;
- WriteLn('FDelete: could not delete directory: ', D);
+ WriteLn('!!! FDelete: could not delete directory: ', D);
end;
end
else begin
if FileExists(D) then begin
if not DeleteFile(D) then begin
Result := False;
- WriteLn('FDelete: could not delete file: ', D);
+ WriteLn('!!! FDelete: could not delete file: ', D);
end;
end;
end;
end;
-{$ifdef windows}
-function FZip(A: String; F: array of AnsiString): Boolean;
+function FTar(A: String; F: array of AnsiString): String;
+var
+ Args: Array of AnsiString;
+ I: Integer;
begin
+ A := A + '.tar.bz2';
+ WriteLn('create ', A);
+ SetLength(Args, Length(F) + 2);
+ Args[0] := '-cjf';
+ Args[1] := A;
+ for I := 0 to Length(F) - 1 do begin
+ writeln(' add ', F[i]);
+ Args[i+2] := F[i];
+ end;
+ if ExecuteProcess(TAR_EXE, Args) = 0 then
+ Result := A
+ else
+ Result := '';
end;
-{$else}
+
function FZip(A: String; F: array of AnsiString): String;
var
Args: Array of AnsiString;
I: Integer;
begin
- A := A + '.tar.bz2';
+ A := A + '.zip';
WriteLn('create ', A);
SetLength(Args, Length(F) + 2);
- Args[0] := '-cjf';
+ Args[0] := '-r';
Args[1] := A;
for I := 0 to Length(F) - 1 do begin
writeln(' add ', F[i]);
Args[i+2] := F[i];
end;
- if ExecuteProcess('/bin/tar', Args) = 0 then
+ if ExecuteProcess(ZIP_EXE, Args) = 0 then
Result := A
else
Result := '';
end;
-{$endif}
function FRename(A, B: String): Boolean;
begin
View
2 src/tools/makezip.lpi
@@ -53,7 +53,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
- <OtherUnitFiles Value="../client;../client/lnet-0.6.5"/>
+ <OtherUnitFiles Value="../core"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
View
24 src/tools/makezip.lpr
@@ -11,18 +11,34 @@
const
BINDIR = '../../bin/';
ZIPDIR = 'libpurpletorchat/';
- LIBNAME = 'libpurpletorchat.so';
+ LIBNAME_LINUX = 'libpurpletorchat.so';
+ LIBNAME_WIN32 = 'purpletorchat.dll';
var
ZipName: String;
begin
- ZipName := 'libpurpletorchat-' + SOFTWARE_VERSION + '-linux-i368';
FDelete(ZIPDIR);
+
+ // this assumes that the binaries have ben built already
+ // and are in the bin folder
+
+ WriteLn;
+ WriteLn('*** making linux archive');
FMkDir(ZIPDIR);
+ FCopy(BINDIR + LIBNAME_LINUX, ZIPDIR);
+ FCopy('readme_plugin_lin.txt', ConcatPaths([ZIPDIR, 'README.txt']));
+ ZipName := 'libpurpletorchat-' + SOFTWARE_VERSION + '-linux-i368';
+ ZipName := FTar(ZipName, [ZIPDIR]);
+ FRename(ZipName, ConcatPaths([BINDIR, ZipName]));
+ FDelete(ZIPDIR);
- FCopy(BINDIR + LIBNAME, ZIPDIR);
- FCopy('readme_plugin.txt', ConcatPaths([ZIPDIR, 'README.txt']));
+ WriteLn;
+ WriteLn('*** making windows archive');
+ FMkDir(ZIPDIR);
+ FCopy(BINDIR + LIBNAME_WIN32, ZIPDIR);
+ FCopy('readme_plugin_win.txt', ConcatPaths([ZIPDIR, 'README.txt']));
+ ZipName := 'purpletorchat-' + SOFTWARE_VERSION + '-win32';
ZipName := FZip(ZipName, [ZIPDIR]);
FRename(ZipName, ConcatPaths([BINDIR, ZipName]));
FDelete(ZIPDIR);
View
5 src/tools/readme_plugin.txt → src/tools/readme_plugin_lin.txt
@@ -13,7 +13,7 @@ libpurpletorchat.so
You also must have tor installed in /usr/sbin/tor which should
normally be the default location of tor if are on a debian based system.
- Now start pidgin from within a console window. You should see a lot of
+ Now start pidgin from within a console window. You should see some
debugging output. Additionally there will be a file ~/purpletorchat.log
which contains the same debug output.
@@ -28,5 +28,4 @@ apart with a human readable name. It will create a config folder
many accounts (profiles) as you want and use them all simultanously.
This early alpha version of the plugin does only support instant
-messaging and NONE of the other features like file transfer, profile
-texts, etc., these will all be implemented in later versions.
+messaging and no file transfer, this will be implemented in later versions.
View
37 src/tools/readme_plugin_win.txt
@@ -0,0 +1,37 @@
+libpurpletorchat.so
+===================
+
+ Put this .dll file into the plugin folder of libpurple which is
+
+ %APPDATA%\.purple\plugins\
+ (you might have to create this folder first)
+
+ or *alternatively* (not recommended) you may put it to the other
+plugin dlls in the Pidgin program folder instead (you will need admin
+rights for this):
+
+ %ProgramFiles%\Pidgin\plugins\
+
+ You also must have Tor installed in the usual location, this must
+be the following folder (this is where the offical Tor installer
+will install Tor.exe):
+
+ %ProgramFiles%\Tor\
+
+ Now start pidgin from within a console window. You should see some
+debugging output. You may also start it from the start menu because it
+will also create a file %APPDATA%\purpletorchat.log which contains the
+same debug output.
+
+ *** note that this is the debug version of the plugin, the
+final release version will not create a debug file. ***
+
+ Create a new account, select "TorChat" for the protocol and when asked
+for a username just enter your name (or anything else), this is NOT the
+TorChat ID, its just an account name to tell different TorChat profiles
+apart with a human readable name. It will create a config folder
+%APPDATA%\torchat2_accountname\ for each account (profile). You can create
+as many accounts (profiles) as you want and use them all simultanously.
+
+ This early alpha version of the plugin does only support instant
+messaging and no file transfer, this will be implemented in later versions.
View
BIN src/tools/z.zip
Binary file not shown.

0 comments on commit 50f3c8d

Please sign in to comment.
Something went wrong with that request. Please try again.