You are not logged in.

#1 2006-12-18 21:08:42

schizoid
Member
Registered: 2006-12-18
Posts: 9

dynamic pacman library

Hello,

I need to create  dynamic or static pacman library , so I can pinvoke pacman methods in C#. I really suck at C so... plese be kind.

So far I can make the dynamic lib. in pacman's src directory

cc -shared pacman.o package.o pacsync.o strhash.o util.o rpmvercmp.o md5driver.o list.o md5.o db.o ../libftp/unshared/ftplib.o /usr/lib/libtar.a /usr/lib/libz.so -o libpacman.so

C# code

using System;
using System.Runtime.InteropServices;


class MainClass
{
    public static void Main (string[] args)
    {
        version();
    }
        
    [DllImport ("libpacman")]
     private static extern void version();
    
}

output

 .--.                  Pacman v2.9.8
/ _.-' .-.  .-.  .-.   Copyright (C) 2002-2006 Judd Vinet <jvinet>
  '-. '-'  '-'  '-'  
 '--'                  This program may be freely redistributed under
                       the terms of the GNU General Public License

... working nicely.

But I'm not happy, how can I acheive the same results by modifing the make system?

Also please point out an pitfalls. is it this simple or am I missing something.

Offline

#2 2006-12-18 22:02:42

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dynamic pacman library

pacman3 already distributes the meat of the package management in library form.

Offline

#3 2006-12-18 22:52:22

schizoid
Member
Registered: 2006-12-18
Posts: 9

Re: dynamic pacman library

YES! I can put off wrapping my head aroung good ole GNU's 1,2,3 make system. Thanks for letting me know. I'll search around for where I can find pacman3 and give it a whirl.

Offline

#4 2006-12-18 22:57:06

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Offline

Board footer

Powered by FluxBB