Skip to content
Permalink
Browse files

dwarf: Fix build failures

Also add modeline and tweak long description.
  • Loading branch information...
ryandesign committed Jan 20, 2017
1 parent 18b7b88 commit 86310cfff25add9f384f44e928b720b568b96d67
@@ -1,3 +1,5 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0

name dwarf
@@ -8,15 +10,15 @@ platforms darwin
maintainers gmail.com:fernando.iazeolla
description a little and powerful object file manipulation tool
long_description dwarf-ng is a powerful object file manipulation tools in \
the spirit of gdb. with dwarf-ng you can read and edit \
the spirit of gdb. With dwarf-ng you can read and edit \
all the file's section headers as well as the raw data. \
With dwarf-ng you can create and customize new file's \
header and it can be used as a compiler back-end to \
create executables/object files. dwarf-ng also permits \
to inject easily new headers and pieces of code/data \
into the file. dwarf-ng currently handles Raw, ELF \
(Elf32, Elf64), PE (Portable executables PE32, PE+) and \
Mach-O (OS X executables 32&64bit) files format. In the \
Mach-O (macOS executables) files formats. In the \
future new files type will be added.
homepage http://github.com/elboza/dwarf-ng/
master_sites http://download.savannah.gnu.org/releases/dwarf-ng \
@@ -26,6 +28,21 @@ checksums md5 c67148b14cec1712732e0aa30e478726 \
sha1 19a69424bd208741a325a4fc0e791a516c3bc8bc \
rmd160 255040679c50046e6c1ecf5f3c806c886b3db573

use_autoreconf yes
autoreconf.cmd ./autogen.sh

depends_lib port:readline
depends_build port:flex \
port:bison

depends_build port:autoconf \
port:automake \
port:bison \
port:flex \
port:libtool

post-extract {
move ${worksrcpath}/src/libdwarf/stdint.h ${worksrcpath}/src/libdwarf/dw_stdint.h
}

patchfiles stdint.patch \
readline-6.3.patch \
return-types.patch
@@ -0,0 +1,11 @@
--- src/cmdline/dw_readline_completion.c.orig 2017-01-20 02:42:05.000000000 -0600
+++ src/cmdline/dw_readline_completion.c 2017-01-20 02:44:27.000000000 -0600
@@ -32,7 +32,7 @@
void initialize_readline()
{
rl_readline_name="dwarf";
- rl_attempted_completion_function=(CPPFunction *)dwarf_completion;
+ rl_attempted_completion_function=(rl_completion_func_t *)dwarf_completion;
rl_completer_word_break_characters = " \t\n\"\\'<=;+*/%^~#{}(),.->$@";
rl_completion_append_character = ' ';
}
@@ -0,0 +1,43 @@
https://github.com/elboza/dwarf-ng/issues/2
--- src/libdwarf/dw_pe_utils.c.orig
+++ src/libdwarf/dw_pe_utils.c
@@ -572,7 +572,7 @@ off_t get_pe_offset2(int sect,int num,int endoffset)
off_t offs;
char ss[15];

- if(!fc_ptr) return;
+ if(!fc_ptr) return 0;
maxsect=get_max_pesect();
mz=(_IMAGE_DOS_HEADER*)fc_ptr->faddr;
peoff=get_data32(mz->e_lfanew);
--- src/libdwarf/dw_switchers.c.orig
+++ src/libdwarf/dw_switchers.c
@@ -155,7 +155,7 @@ struct _var* get_s_val(struct _structvar *ptr)
}
void set_s_val(struct _structvar *ptr,struct _var *val)
{
- if(!fc_ptr) {printf("unknown file.\n"); return NULL;}
+ if(!fc_ptr) {printf("unknown file.\n"); return;}
switch(fc_ptr->file_type){
case FT_ELF:
elf_set_s_val(ptr,val);
--- src/libdwarf/libdwarf.c.orig
+++ src/libdwarf/libdwarf.c
@@ -335,7 +335,7 @@ int growth(off_t len)
off_t offset;
int n;
char *x;
- if(!fc_ptr) {printf("no file opened!\n");return;}
+ if(!fc_ptr) {printf("no file opened!\n");return false;}
if(!fc_ptr->can_grow) {printf("this file cannot change its size\n"); return false;}
if(!fc_ptr->fd) {printf("no file opened!\n");return false;}
x=(char*)malloc(len);
@@ -357,7 +357,7 @@ int shrink(off_t len)
{
off_t offset,new_offset;
int n;
- if(!fc_ptr) {printf("no file opened!\n");return;}
+ if(!fc_ptr) {printf("no file opened!\n");return false;}
if(!fc_ptr->can_grow) {printf("this file cannot change its size\n"); return false;}
if(!fc_ptr->fd) {warn("no file opened!\n");return false;}
offset=lseek(fc_ptr->fd,(off_t)0,SEEK_END);
@@ -0,0 +1,44 @@
--- src/cmdline/dw_readline_completion.c.orig 2011-01-22 07:43:18.000000000 -0600
+++ src/cmdline/dw_readline_completion.c 2017-01-20 02:36:45.000000000 -0600
@@ -26,7 +26,7 @@
#include<stdio.h>
#include<readline/readline.h>
#include<readline/history.h>
-#include"../libdwarf/stdint.h"
+#include"../libdwarf/dw_stdint.h"
#include"dw_readline_completion.h"

void initialize_readline()
--- src/libdwarf/Makefile.am.orig 2011-01-22 08:45:39.000000000 -0600
+++ src/libdwarf/Makefile.am 2017-01-20 02:37:42.000000000 -0600
@@ -25,7 +25,7 @@
macho.h\
pe.h\
mzexe.h\
- stdint.h\
+ dw_stdint.h\
dw_switchers.h\
dw_switchers.c\
dw_elf_utils.h\
--- src/libdwarf/libdwarf.h.orig 2011-01-22 07:43:18.000000000 -0600
+++ src/libdwarf/libdwarf.h 2017-01-20 02:36:26.000000000 -0600
@@ -22,7 +22,7 @@

#include<sys/types.h>
#include "../../config.h"
-#include"stdint.h"
+#include"dw_stdint.h"
#include"utils.h"
#include"vars.h"
#include"elf.h"
--- src/libdwarf/utils.h.orig 2011-01-22 07:43:18.000000000 -0600
+++ src/libdwarf/utils.h 2017-01-20 02:36:15.000000000 -0600
@@ -20,7 +20,7 @@
#ifndef DW_UTILS_H
#define DW_UTILS_H

-#include"stdint.h"
+#include"dw_stdint.h"
typedef enum {bitNULL,bit8,bit16,bit32,bit64,bit128} filebitclass;
#define DUMP_SIZE 128
#define DUMP_MAX_LINE 16

0 comments on commit 86310cf

Please sign in to comment.
You can’t perform that action at this time.